-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: forc mcp server - with forc-call tool integration #7284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Great stuff! Are we supposed to run the server inside a sway project to get access to the contract ABIs? If so, it would be great if we can also enable access to 1.) Verified assets - so that users can easily send transactions just by posting asset names rather than ids. You can find a reference implementation here |
The abi can be provided inline or as URL; hence does not need to be in the server.
In any case all good ideas here - this PR will simply introduce building blocks for performing low level operations (calls, transfers); future PRs could add additional tool-calls/resources (such as ABI generation from sway contract, compilation of contract, abi retrieval from registry, etc.) which should further enhance the functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
Introducing Forc-MCP module (CLI).
The MCP server can be run in 3 modes:
stdio
sse
: long-running server - using http server-side-eventshttp
: long-running server - using http streamsForc-call integration
The first tool to be integrated is
forc-call
- which exposes the following tool calls:list_contract_functions
transfer_assets
get_execution_trace
call_contract
And the following resources:
MCP Type Encoding Reference
MCP Tool Usage Examples
Contract Examples with MCP Tools
Screenshots from
@modelcontextprotocol/inspector
Example usage (claude code)
Pre-requisites:
forc deploy --default-signer
Claude output
Checklist
Breaking*
orNew Feature
labels where relevant.