Custom MCP servers

An MCP server is a web service that offers tools. Add one to your project, and your agent can call its tools during a conversation.

This page uses DeepWiki. It answers questions about public GitHub repositories, and it needs no key.

Add a server

If you don't have an agent named support yet, create one with getstream agents init support --template blank. An agent from the text template answers only about its own company, so this page starts from the blank template. For more about agents, see Creating an agent.

Add DeepWiki to the agent:

getstream agents mcp add deepwiki https://mcp.deepwiki.com/mcp --agent support

Try it:

getstream agents test support --text

Ask: "What is the vercel/next.js repository?" The agent answers with a DeepWiki tool, such as deepwiki__read_wiki_structure.

What the command changed

The command writes the server file and the agent's line and, once, connectors/connector.schema.json for the editor. Commit them.

The server and its URL:

connectors/mcp/deepwiki.yaml
# yaml-language-server: $schema=../connector.schema.json
id: custom_deepwiki
name: deepwiki
url: https://mcp.deepwiki.com/mcp

The line that gives the agent its tools:

agents/support/agent.yaml
# ...
connectors:
  - name: deepwiki
    connector: custom_deepwiki
    connection: deepwiki

See a full agent.yaml for the rest of the file.

To give another agent the same server, or to use it after you clone the repo, leave out the URL. It is already in connectors/mcp/deepwiki.yaml. The connection is already on your app, so the command prints Already connected and only binds the server:

getstream agents mcp add deepwiki --agent billing

Find a server

Look in the official MCP Registry for a server of type streamable-http, or take the URL from the server's docs. The URL must be public https, with no query string.

A server that needs a key

Exa searches the web, and it needs a key. Put the key in the EXA_API_KEY environment variable, then add the server:

getstream agents mcp add exa https://mcp.exa.ai/mcp \
  -H x-api-key=env:EXA_API_KEY --agent support

-H sends the key in the x-api-key header. The file keeps only the header name, never the key. Leave out =env:EXA_API_KEY, and the command asks you for the key.

A header named Authorization sends a bearer token.

Choose the tools

To offer the agent only some of the server's tools, add --tools. read_* matches the server's own tool names, so DeepWiki offers read_wiki_contents and read_wiki_structure, not the deepwiki__ name the agent calls.

If the agent already has the server, unbind it first, then add it with --tools:

getstream agents connectors unbind support deepwiki
getstream agents mcp add deepwiki https://mcp.deepwiki.com/mcp --agent support --tools 'read_*'

Change the URL

getstream agents mcp update deepwiki <new url>

The command writes the new URL into connectors/mcp/deepwiki.yaml. Commit the file. For a server with a key, pass the same -H again.

Or change url in the file yourself and run the command without a URL. It reads the URL from the file.

Remove a server

getstream agents mcp remove deepwiki --agent support

The command takes the tools off the agent, removes the server from your app and deletes its file.

List your servers

getstream agents mcp list

The list shows the servers you added. A server's tools, and which the agent gets, are on Tools. Built-in connectors, such as GitHub, are in the catalog.

Limitations

  • A tool result over 32 KiB is cut, and ends with [connector result truncated]. Return what the model needs, not a whole document.
  • A tool call has 5 seconds. A longer call is cut, and the model reads that the tool did not answer in time and may or may not have done what was asked.

Going further