Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jundot/omlx/llms.txt

Use this file to discover all available pages before exploring further.

oMLX integrates with the Model Context Protocol (MCP), enabling models to call tools provided by external MCP servers — filesystem access, web search, code execution, database queries, and more. The MCP API routes expose these tools directly over HTTP, so you can inspect what tools are available and invoke them from any client without going through the model.
MCP support requires the server to be started with the --mcp-config flag pointing to a valid MCP configuration file. If MCP is not configured, the tools and servers endpoints return empty results and the execute endpoint returns HTTP 503.

List MCP tools

GET /v1/mcp/tools Returns all tools currently available from all connected MCP servers. Each tool entry includes its name (scoped as server_name__tool_name), description, the server it belongs to, and its input schema.

Example

curl http://localhost:8000/v1/mcp/tools

Response

tools
object[]
Array of tool objects from all connected MCP servers.
count
number
Total number of available tools.

Example response

{
  "tools": [
    {
      "name": "filesystem__read_file",
      "description": "Read the contents of a file at the given path.",
      "server": "filesystem",
      "parameters": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Absolute path to the file"
          }
        },
        "required": ["path"]
      }
    },
    {
      "name": "filesystem__list_directory",
      "description": "List the contents of a directory.",
      "server": "filesystem",
      "parameters": {
        "type": "object",
        "properties": {
          "path": {"type": "string"}
        },
        "required": ["path"]
      }
    }
  ],
  "count": 2
}

Execute an MCP tool

POST /v1/mcp/execute Execute a specific MCP tool by name and pass arguments to it. The server routes the call to the appropriate MCP server and returns the result.

Parameters

tool_name
string
required
The full scoped tool name, in the format server_name__tool_name. This matches the name field from GET /v1/mcp/tools.
arguments
object
Arguments to pass to the tool, matching the tool’s JSON Schema parameters. Defaults to an empty object {} if not provided.

Examples

curl http://localhost:8000/v1/mcp/execute \
  -H "Content-Type: application/json" \
  -d '{
    "tool_name": "filesystem__read_file",
    "arguments": {
      "path": "/home/user/notes.txt"
    }
  }'
import requests

response = requests.post(
    "http://localhost:8000/v1/mcp/execute",
    json={
        "tool_name": "filesystem__list_directory",
        "arguments": {"path": "/home/user/projects"},
    },
)
result = response.json()
if result["is_error"]:
    print(f"Error: {result['error_message']}")
else:
    print(result["content"])

Response

tool_name
string
The name of the tool that was executed.
content
string | array | object
The result returned by the MCP tool. The type and structure depend on the specific tool; most tools return a string or a list of content blocks.
is_error
boolean
true if the tool execution resulted in an error.
error_message
string
Error message if is_error is true, otherwise null.

Example response

{
  "tool_name": "filesystem__read_file",
  "content": "# Meeting Notes\n\nTopics discussed: ...",
  "is_error": false,
  "error_message": null
}

Error response (MCP not configured)

{
  "detail": "MCP not configured. Start server with --mcp-config"
}
HTTP status: 503 Service Unavailable.

Build docs developers (and LLMs) love