MCP#
The Model Context Protocol (MCP) allows you to extend gptme with custom tools through external servers. See MCP for configuration and usage details.
MCP server discovery and management tool.
Allows searching for MCP servers in registries and dynamically loading/unloading them.
Available Commands:
/mcp search [query]- Search for MCP servers across all registries/mcp info <server-name>- Get detailed information about a specific server/mcp load <server-name> [config-json]- Dynamically load an MCP server into the current session/mcp unload <server-name>- Unload a previously loaded MCP server/mcp list- List all currently configured and loaded MCP servers
The search command queries the Official MCP Registry (registry.modelcontextprotocol.io).
Once loaded, server tools are available as <server-name>.<tool-name>.
Instructions
### When to use the mcp tool
Use mcp to discover, load, inspect, and manage MCP servers:
- `/mcp search <capability>` finds new servers
- `/mcp load <server-name>` loads one
- `/mcp list` shows what is already loaded
Do not use mcp to call loaded tools; invoke them directly as
`<server-name>.<tool-name>`.
Search uses the Official MCP Registry (registry.modelcontextprotocol.io).
Other commands:
- `info <server>` shows server details
- `resources list/read` browses server resources
- `templates list` lists resource templates
- `prompts list/get` lists or fetches prompts
- `roots list/add/remove` manages advisory workspace roots
Examples
```mcp
search sqlite
```
```mcp
info sqlite
```
```mcp
load sqlite
```
```mcp
list
```
```mcp
unload sqlite
```
```mcp
load my-server
{"command": "uvx", "args": ["my-mcp-server", "--option"]}
```
```mcp
resources list sqlite
```
```mcp
resources read sqlite db://main/users
```
```mcp
templates list sqlite
```
```mcp
prompts list sqlite
```
```mcp
prompts get sqlite create-query {"table": "users"}
```
```mcp
roots list
```
```mcp
roots add filesystem file:///home/user/project Project
```
```mcp
roots remove filesystem file:///home/user/project
```