### Example Claude Desktop Configuration with Multiple MCP Servers Source: https://www.claudemcp.com/docs/en/quickstart An example of a `claude_desktop_config.json` file demonstrating the integration of both the filesystem and sqlite MCP servers. This allows Claude Desktop to manage local files and interact with SQLite databases. ```json { "mcpServers": { "sqlite": { "command": "uvx", "args": ["mcp-server-sqlite", "--db-path", "/Users/cnych/test.db"] }, "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/cnych/src" ] } } } ``` -------------------------------- ### Install Dependencies using Homebrew (macOS) Source: https://www.claudemcp.com/docs/en/quickstart Installs necessary tools like uv, git, and sqlite3 on macOS using the Homebrew package manager. These are prerequisites for setting up the MCP server. ```bash # Using Homebrew brew install uv git sqlite3 ``` -------------------------------- ### Example MCP Interactive Client Session Source: https://www.claudemcp.com/docs/en/streamable-http This is a sample output from running the MCP interactive client. It demonstrates the connection process, the list of available commands, and example interactions such as calling the 'greet' and 'multi-greet' tools, and starting a notification stream. The output also shows tool results and notifications received from the server. ```bash $ node build/client/simpleStreamableHttp.js MCP Interactive Client ===================== Connecting to http://localhost:3000/mcp... Transport created with session ID: a0fdb476-a82f-47bb-927f-58fcc332b5ea Connected to MCP server Available commands: connect [url] - Connect to MCP server (default: http://localhost:3000/mcp) disconnect - Disconnect from server terminate-session - Terminate the current session reconnect - Reconnect to the server list-tools - List available tools call-tool [args] - Call a tool with optional JSON arguments greet [name] - Call the greet tool multi-greet [name] - Call the multi-greet tool with notifications start-notifications [interval] [count] - Start periodic notifications list-prompts - List available prompts get-prompt [name] [args] - Get a prompt with optional JSON arguments list-resources - List available resources help - Show this help quit - Exit the program > list-tools Available tools: - greet: A simple greeting tool - multi-greet: A tool that sends different greetings with delays between them - start-notification-stream: Starts sending periodic notifications for testing resumability > greet james Calling tool 'greet' with args: { name: 'james' } Tool result: Hello, james! > multi-greet claudemcp.com Calling multi-greet tool with notifications... Calling tool 'multi-greet' with args: { name: 'claudemcp.com' } Notification #1: debug - Starting multiple greetings for claudemcp.com > Notification #2: info - Sending first greeting to claudemcp.com > Notification #3: info - Sending second greeting to claudemcp.com > Tool result: Good morning, claudemcp.com! > start-notifications 1000 5 Starting notification stream: interval=1000ms, count=5 Calling tool 'start-notification-stream' with args: { interval: 1000, count: 5 } Notification #4: info - Periodic notification #1 at 2025-04-24T11:30:54.650Z > Notification #5: info - Periodic notification #2 at 2025-04-24T11:30:55.652Z > Notification #6: info - Periodic notification #3 at 2025-04-24T11:30:56.655Z > Notification #7: info - Periodic notification #4 at 2025-04-24T11:30:57.656Z > Notification #8: info - Periodic notification #5 at 2025-04-24T11:30:58.658Z > Tool result: Started sending periodic notifications every 1000ms > ``` -------------------------------- ### Install Context7 MCP via Smithery CLI Source: https://www.claudemcp.com/servers/en/context7 This command installs the Context7 MCP server for Claude Desktop using the Smithery CLI. It's a straightforward way to get the server set up for automatic integration. ```bash npx -y @smithery/cli install @upstash/context7-mcp --client claude ``` -------------------------------- ### Example Prompts for iOS Simulator Interaction Source: https://www.claudemcp.com/servers/ko/ios-simulator-mcp A collection of example prompts demonstrating various interactions with the iOS Simulator MCP Server. These prompts cover inspecting accessibility elements, inputting text, simulating taps and swipes, getting UI element details, taking screenshots, and recording/stopping video. ```text 현재 화면의 모든 접근성 요소 확인 텍스트 입력 필드에 "QA 테스트"를 입력하고 입력이 올바른지 확인 좌표 x=250, y=400을 탭하고 예상 요소가 트리거되는지 확인 x=150, y=600에서 x=150, y=100으로 스와이프하고 올바른 동작 확인 위치 x=300, y=350의 UI 요소를 설명하여 적절한 라벨링과 기능 확인 현재 시뮬레이터 화면의 스크린샷을 촬영하여 my_screenshot.png로 저장 시뮬레이터 화면 녹화 시작 (기본적으로 ~/Downloads/simulator_recording_$DATE.mp4에 저장) 현재 시뮬레이터 화면 녹화 중지 ``` -------------------------------- ### LangGraph Agent Client Example (Python) Source: https://www.claudemcp.com/blogs/tw/langchain-mcp-adapters This Python snippet demonstrates the client-side setup for a LangGraph agent that utilizes MCP tools. It shows how to initialize the agent and connect to the MCP server to leverage its tools within the LangGraph framework. Further details on agent implementation would follow. ```python # This is a placeholder for the client-side code. # The actual implementation would involve importing necessary libraries # from langchain and langchain_mcp_adapters to define the agent and its tools. # Example structure (not fully functional without context): # from langchain_mcp_adapters import MCPClient # from langgraph.graph import StateGraph, END # from langchain_openai import ChatOpenAI # from langchain.agents import AgentExecutor, create_tool_calling_agent, load_tools # # Initialize MCP client # mcp_client = MCPClient(server_url="http://localhost:8000") # Assuming a running MCP server # # Load tools from MCP server # mcp_tools = mcp_client.get_tools() # # Combine with other tools if needed # all_tools = load_tools([], llm=ChatOpenAI()) # all_tools.extend(mcp_tools) # # Define the agent using LangGraph # workflow = StateGraph("YourAgentState") # Replace YourAgentState with the actual state type # # ... add nodes and edges for the agent workflow ... # app = workflow.compile() # # Run the agent # result = app.invoke({"input": "What is 2 + 2?"}) # print(result) ``` -------------------------------- ### Manual Installation Method 2: uvx for Direct Installation Source: https://www.claudemcp.com/servers/tw/dify-mcp-server This JSON configuration demonstrates how to install and run the Dify MCP Server directly from its Git repository using 'uvx' without needing to clone the code locally. It specifies the command, the Git URL, and the target Python module to run, along with the configuration file environment variable. This is the recommended manual installation method. ```json "mcpServers": { "dify-mcp-server": { "command": "uvx", "args": [ "--from","git+https://github.com/YanxingLiu/dify-mcp-server","dify_mcp_server" ], "env": { "CONFIG_PATH": "/Users/lyx/Downloads/config.yaml" } } } ``` -------------------------------- ### Install and Configure Supabase MCP Server (JSON & Shell) Source: https://www.claudemcp.com/servers/tw/supabase-mcp This snippet shows how to configure the Supabase MCP server client, including specifying the command to run and arguments like the access token. It also provides a command-line example for running the server with read-only mode. ```json { "mcpServers": { "supabase": { "command": "npx", "args": [ "-y", "@supabase/mcp-server-supabase@latest", "--access-token", "" ] } } } ``` ```json { "mcpServers": { "supabase": { "command": "cmd", "args": [ "/c", "npx", "-y", "@supabase/mcp-server-supabase@latest", "--access-token", "" ] } } } ``` ```shell npx -y @supabase/mcp-server-supabase@latest --access-token= --read-only ``` -------------------------------- ### Install Dependencies and Playwright Source: https://www.claudemcp.com/servers/en/browser-use-mcp-server Installs project dependencies using uv, installs the Playwright Python package, and downloads the necessary browser binaries for Playwright automation. ```bash uv sync uv pip install playwright uv run playwright install --with-deps --no-shell chromium ``` -------------------------------- ### Development Setup Commands (Bash) Source: https://www.claudemcp.com/servers/zh/firecrawl-mcp Standard commands for setting up and running the development environment for the project. This includes installing dependencies, building the project, and running tests. These commands are in Bash. ```bash # 安装依赖 npm install # 构建 npm run build # 运行测试 npm test ``` -------------------------------- ### Install LangChain MCP Adapter Source: https://www.claudemcp.com/blogs/en/langchain-mcp-adapters Instructions for installing the LangChain MCP Adapter using pip and uv. Dependencies like langgraph and langchain-openai are also mentioned for uv installation. ```bash pip install langchain-mcp-adapters ``` ```bash uv add langchain-mcp-adapters langgraph langchain-openai ``` -------------------------------- ### Install Dependencies for Context7 MCP Development Source: https://www.claudemcp.com/servers/en/context7 This command installs the necessary dependencies for developing the Context7 MCP project using Bun. It's the initial step after cloning the repository. ```bash bun i ``` -------------------------------- ### Run mcp-server-fetch as a script Source: https://www.claudemcp.com/servers/en/fetch This snippet demonstrates how to run the mcp-server-fetch server as a Python script after installation via pip. This command starts the server process. ```bash python -m mcp_server_fetch ``` -------------------------------- ### Build and Install Local Package Source: https://www.claudemcp.com/servers/en/browser-use-mcp-server Commands to build a distributable wheel for the local package and install it globally. This is part of the local development workflow to test changes. ```bash # From the project root directory uv build uv tool uninstall browser-use-mcp-server 2>/dev/null || true uv tool install dist/browser_use_mcp_server-*.whl ``` -------------------------------- ### Install Development Dependencies for SEO MCP Source: https://www.claudemcp.com/servers/ko/seo-mcp This command installs the necessary dependencies for developing the SEO MCP project after cloning the repository. It uses 'uv sync' for efficient dependency management, which is faster than pip install. ```bash uv sync # or pip install -e . ``` -------------------------------- ### Local Development Setup (Bash) Source: https://www.claudemcp.com/servers/tw/claudflare Instructions for setting up the project for local development. This involves installing project dependencies using pnpm, building the project with watch mode enabled, and then running the local server for testing and integration with MCP clients. ```bash pnpm install pnpm build:watch # Then, in a second terminal: node dist/index.js init ``` -------------------------------- ### Install iOS Simulator MCP Server Locally Source: https://www.claudemcp.com/servers/ko/ios-simulator-mcp This snippet outlines the steps for setting up the iOS Simulator MCP Server from its source code. It includes cloning the repository, installing dependencies with npm, building the project, and configuring Cursor MCP to use the local build. ```bash git clone https://github.com/joshuayoes/ios-simulator-mcp cd ios-simulator-mcp npm install npm run build ``` ```json { "mcpServers": { "ios-simulator": { "command": "node", "args": ["/path/to/your/ios-simulator-mcp/build/index.js"] } } } ``` -------------------------------- ### Install mcp-server-fetch using PIP Source: https://www.claudemcp.com/servers/en/fetch This snippet shows how to install the mcp-server-fetch package using pip. Ensure Node.js is installed if you need the more robust HTML simplifier. ```bash pip install mcp-server-fetch ``` -------------------------------- ### Client Execution Example Source: https://www.claudemcp.com/docs/en/write-ts-client Example commands demonstrating how to build and run the MCP client. It shows the typical command-line usage with a path to the server script and the expected output during a test interaction. ```bash node build/index.js /Users/cnych/src/weather-server/build/index.js # output Weather MCP server running on stdio Connected to server with tools: [ 'get_forecast' ] MCP Client Started! Type your queries or 'exit' to exit. Query: Beijing weather for the next 3 days I can get the weather forecast for Beijing for the next 3 days. Let me do that for you now. [Calling tool get_forecast with args {"city":"Beijing","days":3}] # Beijing Weather Forecast ## Next 3 Days: - **March 24, 2025**: 21°C with overcast clouds - **March 25, 2025**: 21°C with scattered clouds - **March 26, 2025**: 20°C with overcast clouds The temperature will remain relatively stable around 20-21°C over the next three days, with cloudy conditions throughout. March 25th will have partially clear skies with scattered clouds, while the other days will be predominantly overcast. Query: ``` -------------------------------- ### Install SEO MCP Dependencies for Development Source: https://www.claudemcp.com/servers/tw/seo-mcp These commands clone the SEO MCP repository and install its development dependencies using 'uv sync'. This is an alternative to 'pip install -e .' for setting up the development environment. ```bash git clone https://github.com/cnych/seo-mcp.git cd seo-mcp uv sync ``` -------------------------------- ### Example uv Configuration for Dify MCP Server Source: https://www.claudemcp.com/servers/en/dify-mcp-server An example JSON configuration for running the Dify MCP Server using 'uv'. This configuration includes specific paths for the server directory and the configuration file, demonstrating how to set up the environment for local execution. ```json { "mcpServers": { "dify-mcp-server": { "command": "uv", "args": [ "--directory", "/Users/lyx/Downloads/dify-mcp-server", "run", "dify_mcp_server" ], "env": { "CONFIG_PATH": "/Users/lyx/Downloads/config.yaml" } } } } ``` -------------------------------- ### Install SEO MCP using pip Source: https://www.claudemcp.com/servers/en/seo-mcp Installs the SEO MCP package from PyPI using pip. Ensure you have Python 3.10 or higher and pip installed. ```bash pip install seo-mcp ``` -------------------------------- ### Install Local Development Build Source: https://www.claudemcp.com/servers/ko/browser-use-mcp-server Uninstalls any existing global installation of the server and then installs the newly built wheel file. This is for testing local changes. ```bash # Install as a global tool uv tool uninstall browser-use-mcp-server 2>/dev/null || true uv tool install dist/browser_use_mcp_server-*.whl ``` -------------------------------- ### Install SEO MCP using uv Source: https://www.claudemcp.com/servers/en/seo-mcp Installs the SEO MCP package using the `uv` package manager. This is an alternative to pip and requires `uv` to be installed. ```bash uv pip install seo-mcp ``` -------------------------------- ### Install Prerequisites with uv Source: https://www.claudemcp.com/servers/en/browser-use-mcp-server Installs necessary prerequisites like uv and mcp-proxy, which are essential for running the browser-use-mcp-server. uv is a fast Python package manager, and mcp-proxy is required for stdio mode. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh uv tool install mcp-proxy uv tool update-shell ``` -------------------------------- ### Install and Run Server in stdio Mode Source: https://www.claudemcp.com/servers/en/browser-use-mcp-server Builds the project into a wheel, installs it globally as a tool, and then runs the server in stdio mode. This mode is used for communication over standard input/output, often integrated with other tools. ```bash # 1. Build and install globally uv build uv tool uninstall browser-use-mcp-server 2>/dev/null || true uv tool install dist/browser_use_mcp_server-*.whl # 2. Run with stdio transport browser-use-mcp-server run server --port 8000 --stdio --proxy-port 9000 ``` -------------------------------- ### Install LangChain MCP Adapters with Uv Source: https://www.claudemcp.com/blogs/tw/langchain-mcp-adapters This command installs the LangChain MCP Adapters library along with other necessary packages (langgraph, langchain-openai) using the uv package manager. This is an alternative installation method for users of uv. ```bash uv add langchain-mcp-adapters langgraph langchain-openai ``` -------------------------------- ### Build and Install for stdio Mode Source: https://www.claudemcp.com/servers/ko/browser-use-mcp-server Builds a distributable wheel for the project and installs it as a global tool using uv. This prepares the server for operation in stdio (standard input/output) mode. ```bash # 1. Build and globally install uv build uv tool uninstall browser-use-mcp-server 2>/dev/null || true uv tool install dist/browser_use_mcp_server-*.whl ``` -------------------------------- ### Install Dependencies with npm Source: https://www.claudemcp.com/servers/en/web-search Installs the necessary Node.js dependencies for the web search server project using npm. ```bash npm install ``` -------------------------------- ### Start Figma Context MCP Server Source: https://www.claudemcp.com/servers/ko/figma-context-mcp Command to start the Figma Context MCP server using npx. Requires replacing '' with the actual Figma access token. ```bash npx figma-developer-mcp --figma-api-key= ``` -------------------------------- ### Example Prompts with Context7 MCP Source: https://www.claudemcp.com/servers/en/context7 These examples demonstrate how to use the 'use context7' command within prompts for LLMs, enabling them to fetch up-to-date information. The prompts are designed to elicit specific code generation tasks. ```txt Create a basic Next.js project with app router. use context7 ``` ```txt Create a script to delete the rows where the city is "" given PostgreSQL credentials. use context7 ``` -------------------------------- ### Tool: webcrawl_sites example Source: https://www.claudemcp.com/servers/zh/mcp-server-webcrawl An example of how to use the `webcrawl_sites` tool to list all crawled sites. ```bash # 你能列出网络爬虫吗? ``` -------------------------------- ### Programmatic Server Implementation Source: https://www.claudemcp.com/servers/en/playwright Guide on how to integrate Playwright MCP directly into a Node.js application for custom server setup and transport mechanisms. ```APIDOC ## Programmatic Server Implementation ### Description This section outlines how to programmatically create and manage a Playwright MCP server within a Node.js application, offering greater control over server options and transport layers. ### Method Node.js Script ### Endpoint N/A ### Parameters #### Request Body (for `createServer`) - **launchOptions** (object) - Optional - Playwright launch options (e.g., `{ headless: true }`). - **Other server options** (if available) - Specific to the MCP server implementation. ### Request Example ```javascript import { createServer } from "@playwright/mcp"; // Import necessary transport classes if needed, e.g., from '@playwright/mcp/lib/sseServerTransport'; async function runMyMCPServer() { const server = createServer({ launchOptions: { headless: true, // other Playwright options... }, // Specify other server options if available }); // Connect to transports (e.g., SSE, custom) // Example for SSE transport (conceptual, requires HTTP server setup): /* const http = require('http'); const { SSEServerTransport } = require('@playwright/mcp/lib/sseServerTransport'); // Adjust path as needed const httpServer = http.createServer((req, res) => { if (req.url === '/messages' && req.method === 'GET') { res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', }); const transport = new SSEServerTransport("/messages", res); server.connect(transport); req.on('close', () => { server.disconnect(transport); }); } else { res.writeHead(404); res.end(); } }); httpServer.listen(8931, () => { console.log('MCP Server with SSE transport listening on port 8931'); }); */ // For simpler non-web transport: // server.connect(yourCustomTransport); console.log("Playwright MCP server started programmatically."); // Keep the server running and handle connections. // Implement server shutdown logic. } runMyMCPServer().catch(console.error); ``` ### Response #### Success Response (N/A - Script execution) N/A #### Response Example N/A ``` -------------------------------- ### Install Project Dependencies Source: https://www.claudemcp.com/servers/en/image-gen-server This section provides commands for cloning the project repository and installing Python dependencies using pip and uv. It also outlines the necessary environment preparations, including Python, npm, and Node.js versions. ```bash git clone https://github.com/fengin/image-gen-server.git cd image-gen-server pip install -r requirements.txt pip install uv ``` -------------------------------- ### Install Development Dependencies with uv Source: https://www.claudemcp.com/servers/en/seo-mcp Installs SEO MCP in editable mode for development using the `uv` package manager. This is an alternative to using pip. ```bash uv sync ``` -------------------------------- ### Install iterm-mcp via Smithery (Bash) Source: https://www.claudemcp.com/servers/en/iterm-mcp This command installs the iterm-mcp server for Claude Desktop automatically using the Smithery CLI. It simplifies the setup process by handling dependencies and configuration. Ensure you have npx installed and available in your PATH. ```bash npx -y @smithery/cli install iterm-mcp --client claude ``` -------------------------------- ### Windows winget을 사용한 필수 도구 설치 Source: https://www.claudemcp.com/docs/ko/quickstart Windows 시스템에 Claude MCP 프로토콜을 사용하기 위한 필수 도구인 uv, Git, SQLite를 winget을 사용하여 설치합니다. 이러한 도구는 Claude 데스크톱이 로컬 데이터베이스와 상호 작용하는 데 필요합니다. ```bash # Using winget winget install --id=astral-sh.uv -e winget install git.git sqlite.sqlite ``` -------------------------------- ### Clone and Install SEO MCP Locally Source: https://www.claudemcp.com/servers/tw/seo-mcp These commands clone the SEO MCP repository from GitHub and install the project locally using pip. This is useful for development or manual installation. It requires Git and Python 3.10+. ```bash git clone https://github.com/cnych/seo-mcp.git cd seo-mcp pip install -e . ``` -------------------------------- ### Run Bright Data MCP Server Source: https://www.claudemcp.com/servers/en/brightdata These examples demonstrate how to initiate the Bright Data MCP server from the command line. The first example uses Node.js package runner (npx) with the necessary API token environment variable. The second shows how to optionally specify a custom browser zone. ```shell # Basic execution with API Token API_TOKEN= npx @brightdata/mcp ``` ```shell # Execution with custom Browser Zone API_TOKEN= BROWSER_ZONE= npx @brightdata/mcp ``` -------------------------------- ### SQLite 데이터베이스 생성 및 데이터 삽입 Source: https://www.claudemcp.com/docs/ko/quickstart Claude MCP 프로토콜 예제를 위해 'products' 테이블이 있는 간단한 SQLite 데이터베이스를 생성하고 샘플 데이터를 삽입합니다. 이 데이터베이스는 Claude 데스크톱이 쿼리할 로컬 데이터 소스로 사용됩니다. ```bash # Create a new SQLite database sqlite3 ~/test.db < --api-key ``` -------------------------------- ### SEO MCP API - Get Backlinks List (Python Example) Source: https://www.claudemcp.com/servers/tw/seo-mcp This Python function demonstrates how to call the `get_backlinks_list` MCP tool to retrieve backlink data for a given domain. It assumes the SEO MCP service is running and accessible. ```python def get_backlinks_list(domain: str): """獲取指定網域的反向連結列表。""" pass # 實際實現會調用 MCP 服務 ``` -------------------------------- ### Create project directory and init npm Source: https://www.claudemcp.com/docs/zh/write-ts-client Creates a directory for the MCP client demo and initializes an npm project. This sets up the basic project structure for the client application. ```bash mkdir mcpclient-demo cd mcpclient-demo npm init -y ``` -------------------------------- ### SEO MCP API - Keyword Generator (Python Example) Source: https://www.claudemcp.com/servers/tw/seo-mcp This Python function shows how to use the `keyword_generator` MCP tool to get keyword and SEO suggestions for a given keyword, country, and search engine. It assumes the SEO MCP service is running. ```python def keyword_generator(keyword: str, country: str = "us", search_engine: str = "Google"): """獲取指定關鍵字的創意和 SEO 建議。""" pass # 實際實現會調用 MCP 服務 ``` -------------------------------- ### Dockerfile for Context7 MCP Server Source: https://www.claudemcp.com/servers/en/context7 This Dockerfile provides instructions for building a Docker image to run the Context7 MCP server. It sets up a Node.js environment, installs the MCP server globally, and defines the command to run it. ```Dockerfile FROM node:18-alpine WORKDIR /app RUN npm install -g @upstash/context7-mcp@latest CMD ["context7-mcp"] ``` -------------------------------- ### Install Dify MCP Server using Smithery CLI Source: https://www.claudemcp.com/servers/en/dify-mcp-server This command installs the Dify MCP Server using the Smithery CLI. It specifies the package name 'dify-mcp-server' and the client as 'claude'. Other supported clients include 'cline, windsurf, roo-cline, witsy, enconvo, cursor'. ```bash npx -y @smithery/cli install dify-mcp-server --client claude ``` -------------------------------- ### Example Log Messages (Text) Source: https://www.claudemcp.com/servers/tw/firecrawl-mcp Sample log messages generated by the Firecrawl MCP Server, illustrating various events such as initialization, scraping start, batch operation queuing, credit usage warnings, and rate limit errors. These logs are essential for monitoring server status and debugging. ```text [INFO] Firecrawl MCP Server 成功初始化 [INFO] 開始爬取 URL: https://example.com [INFO] 批次操作已加入佇列,ID: batch_1 [WARNING] 信用額度使用已達到警告閾值 [ERROR] 超過速率限制,將在 2 秒後重試... ``` -------------------------------- ### Install uvx via Command Line Source: https://www.claudemcp.com/servers/en/PixVerse-MCP This snippet provides commands to copy the uvx executable to a system's PATH for resolving spawn uvx ENOENT errors. It includes separate instructions for Mac/Linux and Windows. ```bash sudo cp ./uvx /usr/local/bin ``` ```batch where uvx ``` -------------------------------- ### Python LangGraph Agent Setup with MCP Adapters Source: https://www.claudemcp.com/blogs/zh/langchain-mcp-adapters This Python code sets up an asynchronous context manager to create a LangGraph agent. It initializes an MCP client to connect to multiple servers (math and weather) and retrieves their tools to be used by the LangChain agent. The `create_react_agent` function from `langgraph.prebuilt` is used to build the agent. ```python from contextlib import asynccontextmanager from langchain_mcp_adapters.client import MultiServerMCPClient from langgraph.prebuilt import create_react_agent from langchain_anthropic import ChatAnthropic model = ChatAnthropic(model="claude-3-5-sonnet-latest") @asynccontextmanager async def make_graph(): async with MultiServerMCPClient( { "math": { "command": "python", # 确保更新到 math_server.py 的完整绝对路径 "args": ["/path/to/math_server.py"], "transport": "stdio", }, "weather": { # 确保你从 weather_server.py 开始 "url": "http://localhost:8000/sse", "transport": "sse", } } ) as client: agent = create_react_agent(model, client.get_tools()) yield agent ``` -------------------------------- ### Install FastMCP with uv Source: https://www.claudemcp.com/servers/ko/backlinks-mcp This code snippet demonstrates how to install the FastMCP library using the 'uv' package manager. 'uv' is a fast Python package installer and resolver. Ensure you have Python 3.8+ and 'uv' installed before running this command. ```bash uv pip install fastmcp ``` -------------------------------- ### Check Node.js Installation Source: https://www.claudemcp.com/servers/ko/supabase-mcp Verify if Node.js is installed on your system. This is a prerequisite for setting up the Supabase MCP Server. If not installed, download it from nodejs.org. ```shell node -v ``` -------------------------------- ### Install Development Dependencies Source: https://www.claudemcp.com/servers/zh/seo-mcp Installs development dependencies for the SEO MCP project after cloning the repository. It uses 'uv sync' for efficient dependency management, or alternatively 'pip install -e .'. Ensure Git and Python 3.10+ are installed. ```bash git clone https://github.com/cnych/seo-mcp.git cd seo-mcp uv sync # or use pip install -e . ``` -------------------------------- ### 創建 SQLite 資料庫並插入數據 Source: https://www.claudemcp.com/docs/tw/quickstart 此代碼片段創建了一個名為 `test.db` 的 SQLite 資料庫,並在其中創建了一個 `products` 表,然後插入了 20 條產品數據。這是設置 Claude MCP 與本地資料庫交互的準備步驟。 ```bash sqlite3 ~/test.db <