MCP stands for Model Context Protocol, an open-source standard for connecting AI agents with external services.Not to be confused with the MPC (Multi-Party Computation) service used by chain signatures.
Usage guide
Since the NEAR MCP Server needs to handle private keys, it is designed to run locally on your machine or on a trusted remote server. Currently there is no hosted version of the NEAR MCP server.Quickstart
You can either install the MCP server globally and start it, or run it directly usingnpx.
- Local
Local MCP server
Once the NEAR MCP starts locally it creates what is called astdio server. To connect your AI agent to the server you will need to use an MCP client library:
Example prompts
The Agent using the MCP server will readily have tools to answer prompts like:- What is the balance of
agency.testnet? - Add the account
example.testnetusing the private keyed25519:... - Transfer 0.1 NEAR from
agency.testnettoexample.testnet - Call the
ft_transfermethod on theusdc.fakes.testnetcontract - What are the public methods of
social.near?
Integrate with AI clients
You can use the NEAR MCP server with any standard MCP client. Here are instructions for some popular clients:- Cursor IDE
- Claude Code
- Claude Desktop
Go to Settings > MCP Servers, and add a new server with the following details:
- Name: near-mcp
- Command: npx
- Arguments: [“-y”, “@nearai/near-mcp@latest”, “run”]
- Environment Variables: (optional) Add any necessary environment variables, e.g.,
NEAR_KEYSTORE.