Model Context Protocol(MCP) 编程极速入门
Model Context Protocol(MCP) 编程极速入门
async with httpx.AsyncClient() as client: response = await client.post( 'https://open.bigmodel.cn/api/paas/v4/tools', headers={'Authorization': '换成你自己的API KEY'}, json={ 'tool': 'web-search-pro', 'messages': [ {'role': 'user', 'content': query} ], 'stream': False } )
Once Model Context Protocol(MCP) 编程极速入门 is connected, these are the calls the assistant has available:
Prompt — @app.prompt('翻译专家') async def translate_expert( target_language: str = 'Chinese', ) -> str: return f'你是一个翻译专家,擅长将任何语言翻译成{target_language}。请翻译以下内容:'Resource — @app.resource('echo://static') async def echo_resource(): # 返回的是,当用户使用这个资源时,资源的内容 return 'Echo!'Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.
Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.
| Tool | What it does |
|---|---|
| web_search | |
| delete_file | |
| image_generation |
{
"mcpServers": {
"web-search-server": {
"command": "uv",
"args": [
"--directory",
"D:/projects/mcp_getting_started",
"run",
"web_search.py"
]
}
}
}From the project documentation. Replace placeholders and example paths before connecting.
Read, search and edit files inside allowed directories with the Model Context Protocol reference Filesystem server.
Retrieve version-aware library documentation and code examples with Context7 MCP, using resolve-library-id and query-docs.
Use Microsoft’s Playwright MCP server to navigate pages, inspect accessibility snapshots, fill forms and capture browser screenshots.
Connect GitHub MCP to repositories, issues and pull requests with GitHub’s hosted service or a locally run server.
Use the Supabase MCP server to inspect database schemas, query project data and retrieve docs through a project-scoped connection.
Search Linear issues and projects, inspect work context and manage updates through Linear’s hosted MCP server with OAuth.