|
| 1 | +--- |
| 2 | +title: Third-party MCP Servers |
| 3 | +--- |
| 4 | + |
| 5 | +The MCP plugin allows you to connect third-party MCP (Model Context Protocol) servers |
| 6 | +to your [Agents](/concepts/agents), enabling them to use tools, resources, and prompts |
| 7 | +from external systems and services. |
| 8 | + |
| 9 | +<AccordionGroup> |
| 10 | + <Accordion title="Key Features" icon="plug"> |
| 11 | + - **Multiple Server Support**: Connect multiple MCP servers simultaneously |
| 12 | + - **Automatic Tool Routing**: Tools are automatically prefixed by server name to avoid conflicts |
| 13 | + - **Standard MCP Protocol**: Compatible with any MCP-compliant server |
| 14 | + - **Proxy Architecture**: Seamlessly integrates external tools into your agent workflows |
| 15 | + </Accordion> |
| 16 | +</AccordionGroup> |
| 17 | + |
| 18 | +## Configuration |
| 19 | + |
| 20 | +Configure the MCP plugin by editing the `~/.unpage/profiles/<profile_name>/config.yaml` file. |
| 21 | + |
| 22 | +Configuration follows the standard MCP server configuration format: each server under the `mcp_servers` key is a dictionary with the following keys, dependent on your chosen transport type: |
| 23 | + |
| 24 | +### For stdio (i.e., local MCP servers) |
| 25 | + |
| 26 | +- `command`: The command to run the MCP server |
| 27 | +- `args`: The arguments to pass to the MCP server command |
| 28 | +- `env`: The environment variables to set for the MCP server |
| 29 | + |
| 30 | +```yaml |
| 31 | +# ~/.unpage/profiles/<profile_name>/config.yaml |
| 32 | + |
| 33 | +# ... |
| 34 | + |
| 35 | +plugins: |
| 36 | + # ... |
| 37 | + mcp: |
| 38 | + enabled: true |
| 39 | + settings: |
| 40 | + mcp_servers: |
| 41 | + git: |
| 42 | + command: "uvx" |
| 43 | + args: ["mcp-server-git", "--repository", "/path/to/git/repo"] |
| 44 | + env: |
| 45 | + GIT_AUTHOR_NAME: "${GIT_USER_NAME:-Unpage}" # Bash-like environment variable expansion |
| 46 | + |
| 47 | +# ... |
| 48 | +``` |
| 49 | + |
| 50 | +### For http (i.e., remote MCP servers) |
| 51 | + |
| 52 | +- `transport`: The transport type of the MCP server (`http`, `streamable-http`, or `sse`) |
| 53 | +- `url`: The URL to connect to the MCP server |
| 54 | +- `auth`: The authentication to use for the MCP server (either a string representing a Bearer token, or "oauth" to use OAuth authentication) |
| 55 | +- `headers`: The HTTP headers to send to the MCP server |
| 56 | + |
| 57 | +```yaml |
| 58 | +# ~/.unpage/profiles/<profile_name>/config.yaml |
| 59 | + |
| 60 | +# ... |
| 61 | + |
| 62 | +plugins: |
| 63 | + mcp: |
| 64 | + enabled: true |
| 65 | + settings: |
| 66 | + mcp_servers: |
| 67 | + github: |
| 68 | + transport: "http" |
| 69 | + url: "https://api.githubcopilot.com/mcp/" |
| 70 | + auth: "Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" |
| 71 | + headers: |
| 72 | + Authorization: "Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" # Bash-like environment variable expansion |
| 73 | + |
| 74 | +# ... |
| 75 | +``` |
| 76 | + |
| 77 | +## Tool Usage |
| 78 | + |
| 79 | +Once configured, tools from MCP servers become available to your agents automatically. |
| 80 | +Tools are prefixed with the server name to prevent conflicts: |
| 81 | + |
| 82 | +- `mcp_git_log` - View git history (from git server) |
| 83 | +- `mcp_filesystem_read_file` - Read file contents (from filesystem server) |
| 84 | +- `mcp_github_create_issue` - Create GitHub issues (from github server) |
| 85 | + |
| 86 | +## Example Agent Configuration |
| 87 | + |
| 88 | +Use MCP tools in your [Unpage Agent](/concepts/agents) configurations: |
| 89 | + |
| 90 | +```yaml |
| 91 | +description: "Agent for code review and repository operations" |
| 92 | +prompt: "You are a code review expert. Use git and filesystem tools to analyze code changes." |
| 93 | + |
| 94 | +tools: |
| 95 | + - "mcp_git_*" # All tools from git server |
| 96 | + - "mcp_filesystem_*" # All tools from filesystem server |
| 97 | + - "mcp_github_create_issue" # Specific tool from github server |
| 98 | +``` |
0 commit comments