Skip to content

· Updated

Openfort MCP Server: Use Openfort from Claude Code and Cursor

Joan Alavedra, Co-Founder at Openfort•7 min read
Openfort MCP Server for AI assistant blockchain tool integration

TL;DR

To use Openfort from Claude Code or Cursor, add the Openfort docs MCP server at https://www.openfort.io/api/mcp for documentation and SDK source, and register the Openfort CLI as a second MCP server with openfort mcp add so the agent can create wallets, policies, and transactions. Install the Openfort agent skills with npx skills add openfort-xyz/agent-skills, and point any other model at https://www.openfort.io/docs/llms.txt. The docs server is read-only; the CLI server acts with your secret key, so give it a test key and a policy-bounded wallet.

Building the Openfort MCP Server was driven by a single goal: to make developer onboarding as fast and autonomous as possible. Traditionally, getting started with a new infrastructure provider meant spending hours reading documentation and manually configuring projects. By using the Model Context Protocol, we flipped that experience, allowing AI assistants to handle the heavy lifting for you.

Since the launch in July 2025, the tooling has split into a docs MCP server, a CLI MCP server, agent skills, and llms.txt. This post covers what MCP is, how to set up Openfort in Claude Code or Cursor today, and how the first version of the server was built.

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard, originally developed by Anthropic, that defines how AI models connect to external tools and data sources. The simplest way to think about it: MCP is to AI tools what USB is to peripherals. Before USB, every device needed its own connector. Before MCP, every AI assistant needed custom code to talk to every external service.

MCP solves three problems at once:

  1. Tool discovery -- An AI assistant connects to an MCP server and immediately knows which tools are available, what parameters they accept, and what they return. No manual wiring required.
  2. Authentication -- MCP supports OAuth-based authentication, so users log in once and the AI can make authorized API calls on their behalf for the duration of the session.
  3. Stateful sessions -- Unlike stateless REST calls, MCP maintains a persistent connection. The server can remember context (like which project you are working on) across multiple tool invocations within a session.

In practice, a developer in Claude Code or Cursor can ask for "a backend wallet on Base Sepolia with a gas sponsorship" and the agent finds the matching Openfort CLI tools and calls them. No hand-written API calls, and no trip to the dashboard.

Use Openfort from Claude Code or Cursor

Openfort gives coding agents two MCP servers. The docs MCP server at https://www.openfort.io/api/mcp lets the agent search and read the Openfort docs and SDK source. The CLI MCP server exposes every Openfort CLI command as a tool, so the agent can create backend wallets, policies, gas sponsorships, and transactions on your account. Add both: the agent looks up how something works with the first and does it with the second.

ToolWhat the agent getsSet it up
Docs MCP server9 read-only tools: search_docs, read_page, list_pages, submit_feedback, and five tools for browsing SDK sourcehttps://www.openfort.io/api/mcp
CLI MCP serverEvery CLI command as a tool, for example accounts_evm_create, policies_create, policies_evaluate, sponsorship_create, transactions_createopenfort mcp add, or npx @openfort/cli --mcp
Agent skillsOpenfort docs, source, and examples packaged as skillsnpx skills add openfort-xyz/agent-skills
llms.txt and MarkdownA page index, the full docs in one file, and any docs page as Markdown by appending .md/docs/llms.txt, /docs/llms-full.txt

Claude Code

Add the docs server:


_10
claude mcp add --transport http openfort-docs https://www.openfort.io/api/mcp

Then install the CLI, log in, and register it as an MCP server. openfort mcp add registers it with Claude Code, Cursor, and Amp:


_10
npm install -g @openfort/cli
_10
openfort login
_10
openfort backend-wallet setup
_10
openfort mcp add

openfort backend-wallet setup stores the wallet secret the CLI needs to create and sign with backend wallets.

Cursor

Add the docs server to .cursor/mcp.json in your project, or ~/.cursor/mcp.json to make it available in every project:


_10
{
_10
"mcpServers": {
_10
"openfort-docs": {
_10
"url": "https://www.openfort.io/api/mcp"
_10
}
_10
}
_10
}

openfort mcp add from the previous section also registers the CLI server in Cursor. To configure it by hand, add a stdio entry:


_10
{
_10
"mcpServers": {
_10
"openfort": {
_10
"command": "npx",
_10
"args": ["@openfort/cli", "--mcp"],
_10
"env": { "OPENFORT_API_KEY": "${OPENFORT_API_KEY}" }
_10
}
_10
}
_10
}

The CLI server runs commands with your secret key (OPENFORT_API_KEY). Use a test key while you build, keep keys in the environment rather than in a committed config, and attach a policy to any wallet the agent controls. Codex CLI and Amp take the docs server too, with codex mcp add openfort-docs --url https://www.openfort.io/api/mcp and amp mcp add openfort-docs https://www.openfort.io/api/mcp. The Use Openfort with AI docs page has the full tool lists.

Skills and llms.txt

The Openfort agent skills give an agent Openfort docs, source, and examples without an MCP connection. Claude Code and Amp pick them up when a task matches:


_10
npx skills add openfort-xyz/agent-skills

For a model with no tool access, point it at /docs/llms.txt for the page index or /docs/llms-full.txt for the whole documentation in one file. Every docs page also returns Markdown if you append .md to its URL, for example https://www.openfort.io/docs/products/embedded-wallet/react.md.

Using Openfort with the Vercel AI SDK

For developers building their own AI-powered applications, Openfort tools can also be accessed through the Vercel AI SDK. Because the Openfort MCP Server implements the standard protocol, it can be connected via the @ai-sdk/mcp package:


_11
import { createMCPClient } from "@ai-sdk/mcp";
_11
_11
const openfortClient = await createMCPClient({
_11
transport: {
_11
type: "http",
_11
url: "https://www.openfort.io/api/mcp",
_11
},
_11
});
_11
_11
// search_docs, read_page, read_source_file, and the other docs tools
_11
const tools = await openfortClient.tools();

Use the docs server to ground a chatbot or support assistant in current Openfort docs. For an agent that has to act, such as creating wallets, checking a policy, or sending a transaction, run the CLI as a stdio MCP server (npx @openfort/cli --mcp). The agentic wallets guide shows that setup with a policy-bounded wallet.

Limitations

Known limitations:

  • Output quality depends on the underlying LLM. Results are non-deterministic and can hallucinate or produce errors.
  • Tool selection is sensitive to prompt phrasing. A slight change in wording can lead the LLM to choose a different tool or skip one entirely.
  • The CLI MCP server acts with whatever key you give it. A live secret key means live transactions, so build with a test key and pair every agent wallet with a policy.
  • MCP support requires an IDE or client that supports custom MCP servers.

How the first version was built

The July 2025 version of the hosted server exposed 42 tools across docs, project management, and project resources, behind OAuth. The notes below describe that build. Today the same endpoint serves the nine docs tools, and account actions run through the CLI MCP server.

Architecture

Deployment

Running the MCP Server locally using stdio was discarded due to setup complexity, lack of centralized monitoring, and difficulty broadcasting tool updates. Instead, we deployed it as a remote server.

The Cloudflare MCP infrastructure provides out-of-the-box deployment with native support for Server-Sent Events (SSE). This enables persistent connections where the server pushes data to clients in real time, similar to WebSockets but server-to-client only.

Authentication

The Cloudflare infrastructure provides the workers-oauth-provider library, an OAuth 2.1 provider that eliminates the need to pass API keys directly through chat or store them in .env files. Authentication uses the PKCE flow, keeping everything server-side. Supabase OAuth provides a second layer of authentication, handled through a custom implementation using the workers-oauth-provider library.

State Management

The McpAgent SDK handles transport and provides session state. During a session, the AI agent stores the API keys from a selected project and routes all subsequent API calls to that project, avoiding repeated manual input.

Structure

The source code follows a simple layout:

  • handlers -- OAuth handlers with a custom Supabase OAuth implementation
  • utils -- HTML forms for the authentication prompt
  • tools -- Tool definitions divided by category (context, management, project)
  • index.ts -- MCP Agent initialization and tool registration

Resources

Share this article

Related Articles

  1. Technical Dive: Openfort's Architecture

    Learn about the Openfort's architecture with our diagrams and see how it can help you get your game to the next level,

  2. Context Protocol agents that can think and pay

    Openfort partners with Context Protocol to give autonomous agents trusted data, verifiable domains, and programmable wallets for secure onchain execution.

  3. Meet the Openfort CLI

    Manage wallets, gas sponsorship, policies, and transaction flows from your terminal across EVM and Solana.

  4. How to Build an Agent Wallet

    Build an agent wallet with Openfort backend wallets: create a TEE-secured wallet, pay gas in USDC, send on Base Sepolia, and add spending limits.

  5. Support for Wallet Asset Discovery

    Openfort now supports ERC-7811 wallet_getAssets, so you can fetch multi-chain asset lists from embedded wallets through an open standard, without an indexer.

  6. Orchestration Platform: Manage Signers and Contracts

    Openfort Orchestration — a unified platform that lets you monitor, debug, and coordinate activity across any signer and any smart contract.

  7. OTP login is boring. That’s why it works.

    Today we’re introducing One-Time Password (OTP) authentication via email and phone number (SMS) in Openfort's SDKs.

  8. How to Build Wallet Permissions with Session Keys

    Build wallet permissions using session keys on smart accounts. Learn to grant agents time-limited, revocable spending power without transferring custody.

Ship your first wallet in minutes

No credit card required • 2,000 operations free