Repository navigation
Starknetjs MCP
#1581
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
RFC: Official MCP Server for starknet.js (
@starknet-io/starknet-mcp)Status: Draft Proposal
Date: February 2026
Summary
This proposal recommends creating an official MCP (Model Context Protocol) server as a companion package to starknet.js. The package would expose core starknet.js capabilities as MCP tools, enabling AI agents and LLM-powered applications to read from and write to Starknet without needing to write integration code.
The server would be published as a separate npm package under the starknet-io org, using
starknetas a peer dependency. It does not modify the core SDK.Motivation
The AI agent ecosystem is rapidly adopting MCP as the standard protocol for tool integration. Claude, OpenAI, Cursor, Windsurf, and other major agent frameworks now support MCP servers natively.
Without an official server, Starknet agent integrations rely on community wrappers with varying quality and maintenance. The starknet-agentic project has demonstrated demand by building a community MCP server around starknet.js — an official package from starknet-io would provide a trusted, canonical integration point that stays in sync with SDK releases.
Why a separate package (not in starknet.js core):
@modelcontextprotocol/sdkand transport layersTool Surface Area
Tools are organized into three categories. The design principle: expose what an agent needs to reason about and act on Starknet, not the entire SDK API.
Read Tools (Provider-level, no account required)
get_balanceaddress,token_address?(defaults ETH)get_blockblock_id?(defaults latest)call_contractcontract_address,entrypoint,calldata,abi?get_transactiontx_hashget_transaction_receipttx_hashestimate_feecalls[]get_nonceaddressget_class_atcontract_addressWrite Tools (Account-level, requires configured account)
executecalls[](contract, entrypoint, calldata)deploy_accountclass_hash,constructor_calldata,saltdeclare_and_deploycontract,constructor_argssign_messagetyped_data,domainUtility Tools (local computation, no chain interaction)
encode_calldataabi,entrypoint,argsdecode_eventsevents[],abiresolve_addressnameoraddressformat_unitsvalue,decimalsparse_unitsvalue,decimalsget_chain_idKey Feature: ABI-Aware Contract Interaction
The most differentiating feature — agents work with human-readable arguments instead of raw felt arrays:
get_class_atto discover a contract's ABIexecutewith:{ contract: "0x...", entrypoint: "transfer", args: { recipient: "0x...", amount: "1.5" } }CallData.compile(), handles unit conversion, estimates fees, and executesThis dramatically lowers the barrier for agents to interact with arbitrary Starknet contracts without deep protocol knowledge.
Configuration
Minimal config requires only an RPC URL. Write tools activate when account credentials are provided.
STARKNET_RPC_URLSTARKNET_NETWORKmainnetSTARKNET_ACCOUNT_ADDRESSSTARKNET_PRIVATE_KEYSTARKNET_MCP_TRANSPORTstdiostdioorhttpScope Boundaries
In scope: Core chain read/write primitives, calldata encoding/decoding, StarknetID resolution, fee estimation, ABI caching.
Explicitly out of scope:
Design principle: This server exposes the same primitives as starknet.js's
ProviderandAccountclasses. Higher-level abstractions should be separate MCP servers or skill packs that build on top of this one.Ecosystem Positioning
Community projects like starknet-agentic benefit by depending on this for low-level ops instead of maintaining their own wrappers — they can focus on DeFi skills, identity workflows, and agent-to-agent protocols.
Implementation Plan
Phase 1 — Read tools + Utilities: All read tools, all utility tools, stdio transport, JSON Schema tool descriptions. Safe to ship fast.
Phase 2 — Write tools + ABI cache:
execute,deploy_account,declare_and_deploy,sign_message. In-memory ABI cache for transparent calldata encoding.Phase 3 — HTTP transport + Hardening: HTTP/SSE transport, rate limiting, session key support (Cartridge Controller), telemetry hooks.
Open Questions
starknet-io/starknet-mcp) or monorepo subfolder within starknet.js?@starknet-io/starknet-mcpvs@starknet-io/starknet-js-mcpvs other?Would love feedback on the tool surface area, scope boundaries, and overall approach. What's missing? What should be cut?
All reactions