Using Metapad via MCP (Claude Desktop / Claude Code)
AdvancedUsing Metapad via MCP (Claude Desktop / Claude Code)
Metapad implements the Model Context Protocol (MCP), allowing external AI tools like Claude Desktop and Claude Code to read and modify your models.
What is MCP?
MCP is a standard protocol that lets AI assistants interact with external data sources. Metapad's MCP API exposes 15 tools for querying and mutating models.
Prerequisites
- Pro plan or higher
- Claude Desktop or Claude Code installed
- Either an API token (see "API Tokens and External Access") or an OAuth login (see "Connecting MCP via OAuth")
Authentication Options
Metapad supports two ways to authenticate MCP connections:
- OAuth (recommended for interactive use): Just log in with your Metapad credentials — no token needed. See "Connecting MCP via OAuth" for details.
- API tokens: Create an
mpt_...token for scripts, CI/CD, or automation. See "API Tokens and External Access".
Connecting Claude Desktop
- Open Claude Desktop settings
- Find the MCP Servers configuration
- Add a new MCP server with:
- Type: HTTP
- URL: Your Metapad MCP endpoint
- Authentication: OAuth (automatic) or Bearer token (
mpt_...)
- Save and restart Claude Desktop
- If using OAuth, a login window will open — sign in with your Metapad credentials
- Claude can now query and modify your model
Connecting Claude Code
- Configure the MCP server in your project's
.claude/settings.jsonor via CLI - Use the same endpoint URL and API token
- Claude Code can now interact with your model during coding sessions
Available MCP Tools
The MCP API provides:
Read tools:
get_metamodel— understand the model's schemasearch_nodes— find nodes by type, name, or propertiesget_node_details— get full details for specific nodesget_relationships— find connections between nodesget_statistics— model stats and countsfind_similar_nodes— detect potential duplicates
Write tools:
create_nodes,update_nodes,delete_nodes,merge_nodescreate_relationships,delete_relationshipsadd_node_type,add_relationship_type,add_allowed_connection
Tips
- Start with
get_metamodelto understand the model's structure - All mutations are applied in real-time — browser users see changes immediately
- MCP access respects the same model data as the web UI
- OAuth connections show your name to collaborators; API tokens show "mcp-api"