heya

Connect your own MCP servers

The Model Context Protocol (MCP) lets you give Heya extra tools. An MCP server is a small program that exposes tools; Heya is the client that connects to it and can then call those tools during a task. You add servers in your config.

Add a server

Each server is a table under [mcp.servers.<name>] in ~/.config/heya/config.toml. The fields:

A local (stdio) server

Many MCP servers are published on npm and run with npx:

[mcp.servers.everything]
transport = "stdio"
command = "npx"
args = ["-y", "@modelcontextprotocol/server-everything"]
enabled = true
tools = ["*"]

A stdio server runs a local command, so that command must be installed. For npx that means Node.js. Heya runs the command; it does not install Node for you. If you are not sure it is there, ask Heya to run node --version.

A remote (http) server

[mcp.servers.acme]
transport = "http"
url = "https://mcp.acme.example/v1"
auth_token_env = "ACME_MCP_TOKEN"
tools = ["search", "create_ticket"]

auth_token_env names the environment variable that holds your token. Set it in your shell (export ACME_MCP_TOKEN=...); Heya reads the value at connect time and never writes it to a file.

An OAuth-protected server

For servers that use OAuth rather than a static token, set auth = "oauth". Heya walks you through the browser flow on first connect and caches the token in your OS keychain (oauth_token_store = "keyring", the default).

[mcp.servers.my-oauth-server]
transport = "http"
url = "https://mcp.example.com/v1"
auth = "oauth"
scopes = ["read", "write"]
oauth_client_name = "Heya"    # label shown in the OAuth prompt
# oauth_token_store = "keyring"  # keyring (default) | memory

auth = "oauth" requires transport = "http" or "sse" and is mutually exclusive with auth_token_env.

Check what connected

Start Heya and run /mcp to list the tools the connected servers expose. If a server is missing, it was skipped (a bad command, a missing token, or an unreachable URL); fix the config and restart.