Your observations are correct that the actual API call logic (e.g., fetching weather or climate data) still resides in the MCP server code and must be implemented by the developer. Adding or removing an MCP server is conceptually similar to adding or removing a tool in traditional AI-tool integrations. However, MCP’s value lies in standardizing and unifying how these tools and data sources are exposed and consumed, enabling scalable, interoperable, and secure two-way communication between AI clients and servers.
Why MCP Server Implementation Still Requires Hardcoding API Calls
- The MCP server acts as a wrapper or adapter around existing APIs, databases, or local data.
- Developers implement the actual logic (e.g., calling a weather API) inside the MCP server’s tool handlers.
- This is similar to how traditional tools require custom connectors or API calls.
- The difference is MCP provides a standard protocol and SDKs that handle communication, discovery, and message formatting, so the AI client can interact with any MCP server uniformly without bespoke integration per tool[1][4][7].
So, while the underlying API call is still hardcoded, MCP abstracts the communication layer, making it easier to add/remove or swap servers without changing the AI client or model prompts.
How MCP Enables Two-Way Communication
Unlike simple one-way API calls, MCP supports bidirectional, persistent communication between the AI client and MCP servers. This is achieved through the JSON-RPC 2.0 protocol layered over transports like STDIO or HTTP+SSE.
Key points on two-way communication:
- Both MCP client and server can send requests and notifications to each other asynchronously[1][6].
- The AI client (host app) initiates the connection and can request data or invoke tools on the MCP server.
- The MCP server can also request completions or responses from the AI client by sending JSON-RPC requests back to the client.
- This allows the server to:
- Ask the AI model for text completions or clarifications.
- Maintain ongoing dialogue or context with the AI.
- Implement complex workflows where the server and AI model collaborate interactively[1][6][8].
Example of MCP server requesting completion from MCP client:
- The server sends a JSON-RPC request like:
{
"jsonrpc": "2.0",
"id": 42,
"method": "completion/create",
"params": {
"prompt": "Please summarize the latest weather data.",
"model": "claude-3.5",
"max_tokens": 100
}
}
- The MCP client (AI host) processes this request by generating a completion using the AI model.
- The client sends back a JSON-RPC response with the generated text.
- This enables server-driven interactions where the server can leverage the AI model dynamically, not just passively respond to client calls[1][6].
Summary
| Aspect | Explanation |
|---|
| Hardcoding API calls | MCP servers still require developers to implement API calls or data access logic inside tools. |
| Adding/removing servers | Similar to adding/removing tools, but MCP standardizes discovery and communication across servers. |
| Two-way communication | MCP uses JSON-RPC 2.0 allowing both client and server to send requests and notifications. |
| Server requesting completions | MCP servers can send requests to the AI client to generate completions, enabling interactive workflows. |
MCP’s innovation is not eliminating the need to write API logic but providing a robust, standardized, and extensible protocol that enables AI models and external systems to communicate flexibly and securely, supporting richer, interactive AI applications beyond simple tool calls[1][3][6][8].
If you want, I can also provide a minimal code snippet illustrating how an MCP server sends a completion request to the client.