> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/blocks/mcp.md).

# mcp

The Model Context Protocol ([MCP](https://modelcontextprotocol.com/)) allows you to connect external tools and services using a standardized protocol, enabling you to integrate APIs and services directly into your workflows. With MCP, you can extend Agent Forge's capabilities by adding custom integrations that work seamlessly with your agents and workflows.

### What is MCP?

MCP is an open standard that enables AI assistants to securely connect to external data sources and tools. It provides a standardized way to:

* Connect to databases, APIs, and file systems
* Access real-time data from external services
* Execute custom tools and scripts
* Maintain secure, controlled access to external resources

### Configuring MCP Servers

MCP servers provide collections of tools that your agents can use. Configure them in workspace settings:

1. Navigate to your workspace settings
2. Go to the **MCP Servers** section
3. Click **Add MCP Server**
4. Enter the server configuration details
5. Save the configuration

You can also configure MCP servers directly from the toolbar in an Agent block for quick setup.

### Using MCP Tools in Agents

Once MCP servers are configured, their tools become available within your agent blocks:

1. Open an **Agent** block
2. In the **Tools** section, you'll see available MCP tools
3. Select the tools you want the agent to use
4. The agent can now access these tools during execution

### Permission Requirements

MCP functionality requires specific workspace permissions:

| Action                            | Required Permission               |
| --------------------------------- | --------------------------------- |
| Configure MCP servers in settings | **Admin**                         |
| Use MCP tools in agents           | **Write** or **Admin**            |
| View available MCP tools          | **Read**, **Write**, or **Admin** |
| Execute MCP Tool blocks           | **Write** or **Admin**            |

### Common Use Cases

#### Database Integration

Connect to databases to query, insert, or update data within your workflows.

#### API Integrations

Access external APIs and web services that don't have built-in Agent Forge integrations.

#### File System Access

Read, write, and manipulate files on local or remote file systems.

#### Custom Business Logic

Execute custom scripts or tools specific to your organization's needs.

#### Real-time Data Access

Fetch live data from external systems during workflow execution.

### Security Considerations

* MCP servers run with the permissions of the user who configured them
* Always verify MCP server sources before installation
* Use environment variables for sensitive configuration data
* Review MCP server capabilities before granting access to agents

### Troubleshooting

#### MCP Server Not Appearing

* Verify the server configuration is correct
* Check that you have the required permissions
* Ensure the MCP server is running and accessible

#### Tool Execution Failures

* Verify tool parameters are correctly formatted
* Check MCP server logs for error messages
* Ensure required authentication is configured

#### Permission Errors

* Confirm your workspace permission level
* Check if the MCP server requires additional authentication
* Verify the server is properly configured for your workspace


---

# 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:

```
GET https://whitepaper.aitech.io/agentforge/blocks/mcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
