Skip to main content

Use MCP Servers

Use this guide when an external MCP server already provides the tool surface you need and you want Anyy to expose only a small, reviewable subset of it.

For the complete config model, see MCP Integration. For the compact field table, see MCP Config Reference.

When To Use MCP

Use MCP when:

  • a useful external tool already exists as an MCP server,
  • you want a clean RPC boundary to a local or hosted system,
  • you need per-server tool filtering, or
  • you want to connect one internal system without adding an Anyy native tool.

Do not use MCP when a built-in Anyy tool already solves the job, or when the server exposes a broad destructive surface that you are not ready to filter.

Mental Model

MCP is an adapter layer:

  • Anyy remains the assistant and resident runtime.
  • MCP servers contribute external tools.
  • Anyy filters those tools before the model can use them.
  • Each server maps to a mcp-<server> toolset.

Good MCP setup is not "connect everything." It is "connect the smallest useful tool surface."

Add One Server First

Start with one low-risk server and an include list:

anyy mcp add project_fs \
--preset filesystem \
--enable \
--include read_file,list_directory \
--activate-toolset \
-- /absolute/project/path

Check what was saved:

anyy mcp list
anyy mcp show project_fs

--activate-toolset adds mcp-project_fs to toolsets.default for new sessions. Anyy rejects activation unless the server is enabled and has a non-empty include list.

Verify Runtime Visibility

With the gateway running:

anyy mcp probe project_fs
anyy mcp test project_fs
anyy mcp status

After changing config, reload the server or restart the gateway:

anyy mcp reload project_fs

Then ask in a fresh or reloaded session:

Which MCP-backed tools are available right now?

If the tools still do not appear, check all visibility gates:

GateCheck
Client enabledmcp.client.enabled: true
Server enabledmcp.client.servers.<id>.enabled: true
Tools allowedtools.include contains server-native tool names
Toolset activemcp-<server> is selected for the session or in toolsets.default

Filter Immediately

Prefer allowlists:

anyy mcp configure github \
--include list_issues,create_issue \
--enable \
--activate-toolset

In YAML, use original MCP tool names in include and exclude:

mcp:
client:
enabled: true
servers:
github:
enabled: true
tools:
include: [list_issues, create_issue]
resources: false
prompts: false

Sanitized Anyy tool names look like mcp_github_list_issues, but the filter list uses server-native names.

Use Hosted MCP Servers

HTTP servers use URLs:

anyy mcp add docs \
--transport http \
--url https://mcp.example.com/mcp \
--header Authorization=secret:mcp/docs/auth_header \
--enable \
--include search

Store a complete sensitive header value in the secret when the remote server expects a value such as Bearer .... Sensitive env and headers values must use secret:, env:, or file: references; literal: is rejected for secret-bearing MCP fields.

For OAuth servers:

anyy mcp add linear \
--transport http \
--url https://mcp.example.com/mcp \
--auth oauth \
--enable \
--include list_issues,create_issue

anyy mcp login linear

Plain HTTP URLs are allowed only for local endpoints. Use HTTPS for remote servers.

Run Anyy As An MCP Server

When another MCP client should talk to Anyy, run:

anyy mcp serve

The Anyy MCP server bridge currently uses stdio transport. Enable only the scopes the client needs under mcp.server.

Common First Patterns

PatternStart with
Local project assistantFilesystem server rooted to one project directory.
Issue triageGitHub server with read/list/create issue tools only.
Internal API assistantHosted MCP server with read-heavy include list.
Documentation serverEnable resource/prompt utilities only when the server supports them and you need them.

Expand the include list only after you have a concrete prompt that needs another tool.

Troubleshooting

SymptomCheck
No tools appearConfirm mcp.client.enabled, server enabled, non-empty tools.include, and active mcp-<server> toolset.
Discovery needs an interactive terminalPass --include a,b --enable, or use --no-discover to save a disabled config.
OAuth calls failRun anyy mcp login SERVER_ID.
Runtime did not updateRun anyy mcp reload SERVER_ID or restart the resident gateway.
Too many tools appearNarrow tools.include and disable resources/prompts unless needed.
Remote HTTP URL is rejectedUse HTTPS, or keep plain HTTP to local endpoints only.