Skip to content
AFK / Docs

Search page titles and summaries. Shortcut: Ctrl / ⌘ K.

MCP Integration

AFK supports the Model Context Protocol (MCP), letting agents connect to approved external tools and services such as databases, APIs, browsers, and SaaS platforms.

Manage MCP servers

From a session, choose Manage MCP servers. The manager shows configured servers, their source and connection state, and an explicit action for the next step:

  • Choose Add server to browse AFK's curated setup recipes or enter a provider's configuration manually.
  • Choose Edit to change a configured server without affecting unrelated entries.
  • Choose Fix when AFK reports invalid configuration or missing secrets.
  • For OAuth servers, use the separate Connect andDisconnect actions. Opening or selecting a row never changes its authorization state.

Recipes are reviewed setup templates, not a general package marketplace. If the service you need is not listed, use the guided HTTP or local-command form with configuration from the service provider. AFK does not guess a package name, endpoint, or authentication scheme for an unknown service.

Choose where a server is available

Every editable server has an explicit availability scope. A server with the same name in a narrower scope overrides the broader definition:

  1. This checkout only — private, machine-local settings in <projectDir>/.afk/mcp.local.json.
  2. This project — shared project settings in <projectDir>/.afk/mcp.json; review before committing them for the team.
  3. All projects on this daemon — user settings in ~/.afk/mcp.json on the selected daemon.

Use a checkout-only override when your command, path, or endpoint differs from the shared project configuration. The manager calls out when saving will create an override rather than silently changing another scope.

Configure a connection

The form supports local stdio commands and remote HTTP/SSE servers. Store tokens and other sensitive values in Secrets and reference them as ${secrets.name}. The editor shows the secrets available in the current account or organization context, flags missing references, and lets authorized users add a required secret while configuring the server.

Stdio server

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
    }
  }
}

HTTP/SSE server

{
  "mcpServers": {
    "my-api": {
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${secrets.api_token}"
      }
    }
  }
}

Use the advanced JSON editor for provider-specific fields that are not represented in the guided form. Switching between the guided and advanced editors preserves those additional fields when you save.

Built-in providers

AFK includes several runtime-managed providers. They appear as available on demand and start only when needed; do not install another copy through the Add server recipes.

ProviderDescription
playwrightIsolated, repeatable browser automation.
chrome-devtoolsDebugging, inspection, and WebMCP tools for a user-approved running Chrome instance.
tree-sitterStructural code parsing for precise code understanding.

Connecting Chrome DevTools

The chrome-devtools provider attaches to a Chrome session you explicitly approve, so an agent can inspect an authenticated tab and use WebMCP tools exposed by the page. In Chrome 144 or later, open chrome://inspect/#remote-debugging, enable remote debugging, then approve the connection when AFK starts the provider.

Connecting gives the selected agent access to open tabs in that Chrome profile, including authenticated sites. Close sensitive tabs before connecting. For isolated, repeatable automation, use playwrightinstead.

OAuth connections

When a configured HTTP server requires OAuth, choose its explicit Connect action and complete the provider authorization flow. AFK stores the resulting grant securely and uses it for future requests to that server. In an organization workspace, each member authorizes their own external account. Use Disconnect to revoke AFK's saved connection; selecting the row itself does not connect or disconnect anything.

Reloading MCP config

After editing configuration, use the reload tool or the /reload browser command to re-read session capabilities without restarting the session. Idle built-in providers still start on demand; reload is not an installation step.

MCP elicitation

MCP servers can ask for structured mid-task input. AFK shows those requests as browser forms, sends the response back to the server, and keeps the resolved interaction in the session transcript for auditability.

You can also use hooks to apply team-specific handling for repeated MCP prompts. See Hooks Reference.

Plugin MCP servers

Plugins can contribute MCP servers for repeatable team workflows. Store sensitive values in Secrets and reference them from plugin configuration rather than committing raw tokens. Plugin and built-in entries may be visible in the manager without being editable as project, checkout, or daemon-user configuration.

AFK as an MCP server

AFK can expose an authenticated MCP endpoint so approved external clients can start, message, inspect, wait for, resume, or stop AFK sessions. Use this for controlled automation from other tools or internal workflows.