OpenAgent
Features

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:

  1. Describing tools — what tools exist and how to call them
  2. Tool execution — how the agent calls a tool and receives a result
  3. 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:

ToolDescription
web_searchSearch the web using configured search providers
web_fetchFetch and parse the content of any URL
code_executeExecute Python, JavaScript, or shell code in a sandbox
knowledge_searchExplicitly search a knowledge base
calculatorPerform mathematical calculations
datetimeGet current date, time, and timezone information
image_generateGenerate 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/directory

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

  1. The user's request
  2. The system prompt (you can instruct the agent when to use which tools)
  3. 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" }
  }
}

The MCP ecosystem has a growing library of ready-to-use servers:

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.

On this page