Skip to content
Goal: 了解 → 熟练使用✓ Sources verified 2026-11-24MCPToolsResources

MCP: Connecting Tools and Data to Models in a Standard Way ​

MCP touches "integration", "agent orchestration" and "connecting to third-party systems", and has been a hot topic for AI application roles since 2025.

Core concepts ​

  • What it is: an open protocol that defines how AI applications (Host / Client) communicate with MCP Servers that provide tools and data. The usual analogy: a "USB-C port" for the agent world.
  • Three roles: Host (an IDE, a chat app) → contains a Client → connects to one or more Servers.
  • What a Server provides:
    • Tools: functions the model can call (the most common)
    • Resources: readable data (files, database records)
    • Prompts: reusable prompt templates
  • Transports: stdio for local processes; Streamable HTTP for remote services (the earlier HTTP+SSE transport has been superseded).
  • Message format: JSON-RPC 2.0.

How it works: what happens during one tool call ​

1. The Client connects to the Server, initializes, and negotiates the protocol version and capabilities
2. The Client calls tools/list to get the tool list (name, description, inputSchema)
3. The Host turns the tool list into the model's tool definitions → the model decides to call one
4. The Client sends tools/call → the Server executes → returns the result
5. The Host hands the result back to the model as a tool_result

So MCP doesn't replace tool calling: on the model side it's still tool calling. MCP solves "where tools come from and how to connect them uniformly".

Spec versions ​

The spec is released in dated versions. The 2025-11-25 version added experimental tasks (long-running tasks that can be polled), URL-mode elicitation and more; later versions are still evolving.

In practice: writing a Server with the official Python SDK ​

python
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("contract-tools")

@mcp.tool()
def lookup_customer(name: str) -> dict:
    """Look up a customer profile by full company name. Only for verifying contract parties; must not be used to modify data."""
    return crm.find(name)

if __name__ == "__main__":
    mcp.run()          # stdio transport by default

Common pitfalls ​

  1. Security: an MCP Server can perform arbitrary actions, and the content a tool returns may contain prompt injection. Only connect trusted Servers, require human confirmation for sensitive actions, and grant minimal permissions.
  2. Too many tools: after connecting several Servers the tool count balloons, which hurts the model's selection accuracy and eats context.
  3. Treating MCP as mandatory: for calls inside your own backend, just write a tool. MCP's value lies in cross-application reuse and the ecosystem.

Common interview questions ​

  1. What problem does MCP solve? How does it relate to function calling?
  2. What are MCP's Tools, Resources and Prompts?
  3. Which scenarios suit the stdio transport and which suit Streamable HTTP?
  4. What security risks come with connecting third-party MCP Servers?

How it relates to my projects ​

  • The "query task status, submit human review result" features of the AI Document Review Pipeline could be wrapped as an MCP Server, as a project highlight.

To be verified / may go stale

  • The MCP spec has had further revisions after 2025-11-25 (e.g. changes to transports). Follow specification/latest on the official site.
  • The official Python SDK's import path (mcp.server.fastmcp) may change between major versions.

Sources ​

Vin Amory · AI development × content creation · Technical notes cite official docs in each page’s sources section