### Clone and Setup MetaMCP Repository Source: https://docs.metamcp.com Clone the MetaMCP repository from GitHub and set up the initial environment by copying the example .env file. ```bash git clone https://github.com/metatool-ai/metamcp.git cd metamcp cp example.env .env ``` -------------------------------- ### Basic MCP Server Configuration Example Source: https://docs.metamcp.com/cn/concepts/mcp-servers Defines a basic MCP server configuration, including its name, type, command, arguments, and a description. ```json { "name": "HackerNews", "type": "STDIO", "command": "uvx", "args": ["mcp-hn"], "description": "访问 HackerNews 故事和评论" } ``` -------------------------------- ### MCP Server Configuration with Environment Variables Source: https://docs.metamcp.com/cn/concepts/mcp-servers Example of configuring a STDIO MCP server with specific environment variables, like setting the timezone. ```json { "name": "TimeServer", "type": "STDIO", "command": "uvx", "args": ["mcp-server-time", "--local-timezone=America/New_York"], "env": { "TZ": "America/New_York" } } ``` -------------------------------- ### Exported MCP Server Configurations Source: https://docs.metamcp.com/cn/concepts/mcp-servers Example of the JSON structure when exporting multiple MCP server configurations, including their types, commands, arguments, environment variables, and descriptions. ```json { "mcpServers": { "HackerNews": { "type": "stdio", "command": "uvx", "args": ["mcp-hn"], "description": "访问 HackerNews 故事和评论" }, "TimeServer": { "type": "stdio", "command": "uvx", "args": ["mcp-server-time"], "env": { "TZ": "America/New_York" }, "description": "时间和时区实用工具" }, "RemoteAPI": { "type": "streamable_http", "url": "https://api.example.com/mcp", "bearerToken": "your-bearer-token", "description": "通过 HTTP 的远程 MCP 服务器" } } } ``` -------------------------------- ### STDIO Server Authentication with API Key Source: https://docs.metamcp.com/cn/concepts/mcp-servers Shows how to configure authentication for a STDIO server using an API key passed via environment variables. ```json { "env": { "API_KEY": "your-secret-key" } } ``` -------------------------------- ### MCP Server Configuration with Environment Variable Interpolation Source: https://docs.metamcp.com/cn/concepts/mcp-servers Demonstrates using environment variable interpolation `${ENV_VAR}` within the 'env' section for dynamic configuration. ```json { "name": "ExampleServer", "type": "STDIO", "command": "uvx", "args": ["mcp-example"], "env": { "API_KEY": "${API_KEY}", "DEBUG": "true" } } ``` -------------------------------- ### STDIO MCP Server Configuration Source: https://docs.metamcp.com/cn/concepts/mcp-servers Configuration for a STDIO type MCP server, specifying the command, arguments, and environment variables. ```json { "type": "STDIO", "command": "uvx", "args": ["mcp-server-package"], "env": { "API_KEY": "your-api-key" } } ``` -------------------------------- ### Remote Server Authentication with Bearer Token Source: https://docs.metamcp.com/cn/concepts/mcp-servers Illustrates configuring authentication for remote servers (SSE or Streamable HTTP) using a bearer token. ```json { "bearerToken": "your-bearer-token" } ``` -------------------------------- ### Required Fields for MCP Server Configuration Source: https://docs.metamcp.com/cn/concepts/mcp-servers Lists the essential fields required for any MCP server configuration: name, type, command/URL. ```json { "name": "unique-server-name", "type": "STDIO|SSE|STREAMABLE_HTTP", "command": "command-to-run", "args": ["arg1", "arg2"], "url": "https://...", } ``` -------------------------------- ### Streamable HTTP MCP Server Configuration Source: https://docs.metamcp.com/cn/concepts/mcp-servers Configuration for a Streamable HTTP MCP server, specifying the URL and bearer token for authentication. ```json { "type": "STREAMABLE_HTTP", "url": "https://api.example.com/mcp", "bearerToken": "your-bearer-token" } ``` -------------------------------- ### Optional Fields for MCP Server Configuration Source: https://docs.metamcp.com/cn/concepts/mcp-servers Lists optional fields that can be included in an MCP server configuration, such as description, environment variables, and bearer token. ```json { "description": "人类可读的描述", "env": { "KEY": "value" }, "bearerToken": "auth-token" } ``` -------------------------------- ### SSE MCP Server Configuration Source: https://docs.metamcp.com/cn/concepts/mcp-servers Configuration for a Server-Sent Events (SSE) MCP server, including its URL and bearer token for authentication. ```json { "type": "SSE", "url": "https://api.example.com/sse", "bearerToken": "your-bearer-token" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.