> For the complete documentation index, see [llms.txt](https://vibemx.gitbook.io/neuronai-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vibemx.gitbook.io/neuronai-studio/mcp-servers/agent-binding.md).

# Agent Binding

Bind MCP servers to agents to expose their tools during Playground sessions and workflow agent nodes.

## Bind in the agent editor

1. Open an agent for editing
2. Add an MCP server binding
3. Optionally filter tools with **only** / **exclude** lists
4. Save

```mermaid
flowchart TB
    Agent[AgentDefinition] --> Pivot[neuronai_studio_agent_mcp_server]
    Pivot --> Server[McpServer record]
    Server --> Resolver[McpToolResolver]
    Resolver --> Tools[Discovered MCP tools]
    Tools --> DynamicAgent[DynamicAgent at runtime]
```

## Ref format

MCP tools use the ref pattern:

```
mcp:{server_key}:{tool_name}
```

Examples:

* `mcp:filesystem:read_file`
* `mcp:telescope:query_requests`

When binding an entire server, the agent receives all discovered tools (subject to only/exclude filters).

## Filter tools

Same as regular tool bindings:

```json
{
  "ref": "mcp:filesystem",
  "only": ["read_file", "list_directory"],
  "exclude": ["write_file"]
}
```

## Database schema

The `agent_mcp_server` pivot table (prefixed, e.g. `neuronai_studio_agent_mcp_server`) links agents to MCP servers with optional filter JSON.

## Workflow usage

Agent nodes in workflows use agents with pre-configured MCP bindings. The **MCP node** can also call MCP tools directly without going through an agent. See [AI Nodes](/neuronai-studio/workflows/ai-nodes.md).

## Troubleshooting

| Issue               | Check                                    |
| ------------------- | ---------------------------------------- |
| Tools not appearing | Run Test Discovery in MCP editor         |
| Stdio server fails  | Command in allowlist? Process installed? |
| HTTP server fails   | URL reachable? Token set in `.env`?      |
| Timeout             | Network latency, server startup time     |

## Next steps

* [MCP Overview](/neuronai-studio/mcp-servers/overview.md)
* [Creating Agents](/neuronai-studio/agents/creating-agents.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vibemx.gitbook.io/neuronai-studio/mcp-servers/agent-binding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
