Deploying Model Context Protocol (MCP) Servers for Agent Discovery
Deploy Model Context Protocol (MCP) servers over Streamable HTTP and stdio for secure tool exposure and agent discovery.
Executive TL;DR:
- Autonomous AI agents frequently encounter integration bottlenecks due to fragmented custom API connectors when interacting with diverse enterprise data sources and tools.
- The Model Context Protocol (MCP) resolves this engineering challenge by standardising a lightweight, stateless tripartite communication architecture over stdio and Streamable HTTP.
- By deploying compliant MCP servers, organisations can expose structured schemas that allow external orchestration engines to dynamically discover, validate, and execute agent capabilities without manual adapter code.
Supported Protocol Revision: MCP revision
2026-07-28. Supported transports: stdio and Streamable HTTP. Legacy SSE-only transport references are deprecated in favor of Streamable HTTP per ADR-067. Primary specification source: MCP 2026-07-28 Discover Spec.
How Does the Model Context Protocol Standardise Agent-to-Tool Discovery?
The Model Context Protocol (MCP), co-founded and governed by the Agentic AI Foundation under the Linux Foundation, is an open-standard communication protocol that standardises how artificial intelligence models securely read data, execute functions, and retrieve context from dynamic environments. It replaces custom-coded integrations with a uniform interface where clients programmatically negotiate capabilities with lightweight server endpoints over stateless, JSON-RPC 2.0-compliant transport lanes.
- Tools: Executable functions that empower an autonomous agent to take deterministic actions on behalf of the user or system, governed by explicit safety annotations.
- Resources: Read-only, schema-enforced data structures (such as databases, vector stores, or files) that the agent can programmatically pull into its context window for real-time grounding.
- Prompts: Pre-structured templates and contextual workflow guidelines designed to simplify agent reasoning patterns and reduce model token consumption.
How to Deploy a Secure MCP Server with Drizzle ORM and Tool Annotations
Deploying a secure MCP server requires exposing a standardized manifest and configuring a backend database to safely map polymorphic server capabilities while enforcing runtime security policies. The following Drizzle ORM schema and corresponding JSON manifest demonstrate illustrative code under The Agent Gateway compliance framework for registering an MCP server, enforcing permission grants, and programmatically flagging destructive tools to enable human-in-the-loop authorization.
import { pgTable, uuid, text, boolean, pgEnum, timestamp, jsonb } from "drizzle-orm/pg-core";
// Enums representing the protocol type and compliance tier
export const agentProtocolEnum = pgEnum("agent_protocol", ["A2A", "MCP"]);
export const complianceTierEnum = pgEnum("compliance_tier", ["Not Assessed", "Tier 1 - Signed Wallet", "Tier 2 - KYC Cleared"]);
// The agents table storing registered agent capabilities and metadata
export const agents = pgTable("agents", {
id: uuid("id").defaultRandom().primaryKey(),
name: text("name").notNull(),
slug: text("slug").unique().notNull(), // derived programmatically via slugify(name + hostname)
targetUrl: text("target_url").notNull(),
protocol: agentProtocolEnum("protocol").notNull(),
supportsMcpSchema: boolean("supports_mcp_schema").default(false).notNull(), // Exposes MCP compatibility status
complianceTier: complianceTierEnum("compliance_tier").default("Not Assessed").notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
// The agent_tool_grants table maps polymorphic MCP tools and enforces explicit is_destructive security filters
export const agentToolGrants = pgTable("agent_tool_grants", {
id: uuid("id").defaultRandom().primaryKey(),
agentId: uuid("agent_id").references(() => agents.id).notNull(),
toolName: text("tool_name").notNull(),
manifestData: jsonb("manifest_data").notNull(), // Stores the full tool schema and annotation block
createdAt: timestamp("created_at").defaultNow().notNull(),
});
// Illustrative MCP Server capabilities payload demonstrating tool annotation and transport endpoints (revision 2026-07-28)
export const mcpServerManifestPayload = {
"protocol_revision": "2026-07-28",
"server_identity": {
"name": "enterprise_db_connector",
"vendor": "Natoma Labs",
"registry_uri": "mcp://registry.pulsemcp.example.com/db-ent"
},
"capabilities": {
"tools": [
{
"name": "query_inventory",
"description": "Scans the warehouse inventory database for active stock counts.",
"annotation": {
"is_destructive": false,
"requires_approval": false,
"oauth_scope": "db:read"
}
},
{
"name": "purge_stale_sessions",
"description": "Permanently deletes expired user sessions from the relational database.",
"annotation": {
"is_destructive": true,
"requires_approval": true,
"oauth_scope": "db:write"
}
}
],
"resources": [
"file:///var/mcp/context/database_dictionary.md"
]
},
"transport": {
"type": "streamable_http",
"endpoint": "https://mcp.internal.example.com/mcp",
"auth": "oauth_2_1"
}
};
| Architectural Attribute | Model Context Protocol (MCP) | Agent-to-Agent (A2A) Protocol |
|---|---|---|
| Primary Integration Focus | Localized model-to-tool and model-to-data connectivity. | Collaborative task delegation and cross-boundary messaging. |
| Transport Specification | Lightweight, stateless JSON-RPC over stdio and Streamable HTTP. | Secure JSON-RPC 2.0 over HTTPS with optional Server-Sent Events (SSE) streaming. |
| Identity/Discovery Method | Server capability advertisements; registries like PulseMCP. | Publicly hosted Agent Cards at /.well-known/agent-card.json (legacy v0.2 agent.json). |
| Security & Auditing | Method-level ACLs, tool annotations, and gateway mediation. | Actor-aware token exchange (RFC 8693) and cryptographic signatures. |
Which Verified Agents Support MCP for Enterprise Tool Discovery?
To deploy highly reliable, vetted tool-calling agents within your enterprise estate, refer to our comprehensive platform directory. Full-stack developers and solutions architects can instantly search, filter, and access agents with verified MCP compatibility. Every listed server is dynamically benchmarked for transport security, real-time query latency, and compliance-by-design tool annotations before listing is permitted.
Browse all MCP-compatible agents in the directory →
The Agent Compliance Grader evaluates MCP server compliance and execution latency. Register for early access ahead of your enterprise deployment.
Common MCP Server Deployment Architecture Questions
- Q: What is the security implication of deploying an MCP server without explicit tool annotations like "annotation.is_destructive" inside the Agent Gateway?
- A: If an MCP server exposes destructive capabilities (such as database write, update, or delete commands) without explicit
is_destructiveannotations, an autonomous agent executing workflows is highly vulnerable to Prompt-to-Transaction (P2T) and tool-poisoning attacks. To mitigate this, the Agent Gateway intercepts the tool call, scans for annotations via a GIN-indexedagent_tool_grantstable, and automatically suspends the execution thread to force a Human-in-the-Loop (HITL) approval gate before execution.
- A: If an MCP server exposes destructive capabilities (such as database write, update, or delete commands) without explicit
- Q: How does the latest stateless MCP specification affect performance and horizontal scalability in cloud-hosted Next.js environments?
- A: By transitioning the core protocol layers to be stateless over Streamable HTTP, MCP servers no longer require persistent WebSocket or session state synchronization. This allows Next.js Edge Functions and serverless runtimes to immediately spin up, handle JSON-RPC requests over secure Streamable HTTP, and tear down in milliseconds without memory leakage or cold start bottlenecks.
Latest Articles
View allEnforcing Walled Garden Guardrails: SAP API Policies and Adobe CX
Enforce enterprise guardrails across SAP API policies and Adobe CX to prevent data exfiltration, token leakage, and unauthorized agent actions.
Agent-to-Agent (A2A) Interoperability and UI Handoffs
Master A2A protocol specifications and AG-UI handshakes for cross-domain agent task delegation, UI state coordination, and human oversight.
The AISO Blueprint: Implementing llms.txt, JSON-LD, and Markdown
Traditional web architectures rely heavily on client-side rendering and narrative-heavy content, which render platforms virtually invisible to autonomous agents and non-human web crawlers. AI Search Optimization (AISO) and Generative Engine Optimization (