MCP Tool Use
Give your agents superpowers with the Model Context Protocol.
MCP Tool Use
MCP (Model Context Protocol) is an open standard that allows AI agents to use external tools and services. OpenAgent has native MCP support, meaning your agents can call APIs, run code, search the web, read files, and perform virtually any action you define.
What is MCP?
MCP defines a standard protocol for:
- Describing tools — what tools exist and how to call them
- Tool execution — how the agent calls a tool and receives a result
- Server communication — how the agent connects to tool servers (stdio, SSE, HTTP)
Any service that implements the MCP server protocol can be used as a tool by your OpenAgent agents — no custom integration code required.
Built-in Tools
OpenAgent ships with a set of built-in tools ready to use:
| Tool | Description |
|---|---|
web_search | Search the web using configured search providers |
web_fetch | Fetch and parse the content of any URL |
code_execute | Execute Python, JavaScript, or shell code in a sandbox |
knowledge_search | Explicitly search a knowledge base |
calculator | Perform mathematical calculations |
datetime | Get current date, time, and timezone information |
image_generate | Generate images (requires an image model provider) |
Built-in tools are enabled per agent. Go to Agent Settings → Tools to enable them.
Adding Custom MCP Servers
You can connect any MCP-compatible server to give agents additional capabilities.
Start your MCP server
Your MCP server can run as a local process or a remote HTTP/SSE service. For example, a filesystem tool server:
npx @modelcontextprotocol/server-filesystem /path/to/directoryRegister the server in OpenAgent
Go to Settings → MCP Servers → Add Server.
For servers communicating via standard input/output:
{
"name": "Filesystem",
"transport": "stdio",
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/data"]
}For remote servers with Server-Sent Events or HTTP transport:
{
"name": "My API Server",
"transport": "sse",
"url": "https://tools.example.com/mcp"
}Attach to an agent
Go to Agent Settings → MCP Servers and select the server. The agent will now have access to all tools exposed by the server.
Test the tool
Open the agent's Chat panel and ask it to use the tool. For example, with a filesystem server:
User: What files are in the /data/reports directory?
Agent: [calls list_directory tool] → Here are the files in /data/reports: ...How Agents Use Tools
When the agent receives a message, it decides whether to use a tool based on:
- The user's request
- The system prompt (you can instruct the agent when to use which tools)
- The tool descriptions (clear descriptions help the LLM choose correctly)
The tool-use loop looks like this:
User: "Search for the latest news about AI agents"
│
▼
Agent thinks: "I should use web_search for this"
│
▼
Tool call: web_search("latest news AI agents 2025")
│
▼
Tool result: [list of search results]
│
▼
Agent thinks: "I have the results, I can now answer"
│
▼
Agent: "Here are the latest developments in AI agents: ..."Writing Good Tool Descriptions
When building a custom MCP server, clear tool descriptions are critical. The LLM uses them to decide when and how to call each tool.
Good description:
{
"name": "get_customer_orders",
"description": "Retrieve all orders for a customer by their customer ID. Use this when the user asks about order history, order status, or past purchases.",
"parameters": {
"customer_id": {
"type": "string",
"description": "The unique customer identifier (e.g., 'CUST-12345')"
}
}
}Bad description:
{
"name": "get_orders",
"description": "Gets orders",
"parameters": {
"id": { "type": "string" }
}
}Popular MCP Servers
The MCP ecosystem has a growing library of ready-to-use servers:
File System
Read, write, and list files in a directory.
GitHub
Search repos, read files, create issues and PRs.
PostgreSQL
Query databases with natural language.
Slack
Send messages and read channel history.
Building a Custom MCP Server
You can implement an MCP server in any language using the official SDKs:
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new McpServer({ name: 'my-tools', version: '1.0.0' });
server.tool(
'get_weather',
{ city: { type: 'string', description: 'City name' } },
async ({ city }) => {
const weather = await fetchWeather(city);
return { content: [{ type: 'text', text: JSON.stringify(weather) }] };
}
);
const transport = new StdioServerTransport();
await server.connect(transport);See the official MCP documentation for server SDKs in Python, TypeScript, and other languages.