Contribute to Flow MCP
This tutorial will guide you through the process of contributing to the Flow MCP server. The Model Context Protocol (MCP) is an open standard developed by Anthropic that enables AI applications to interact seamlessly with external tools, systems, and data sources.
Learning Objectives
After completing this tutorial, you should be able to:
- Set up and build the Flow MCP server development environment.
- Create and register a new Action Tool, including schema, handler, and tests.
- Test and validate the functionality of a new Action Tool within the MCP system.
- Submit a complete pull request that follows Flow MCP contribution guidelines.
Prerequisites
- Bun - the JavaScript runtime
- Flow MCP server - the Flow MCP server repository
Installation
-
Fork the Flow MCP server repository
-
Clone the repository
-
Install the dependencies
-
Build the project
Create new Action Tool for Flow MCP
-
Create a new folder in the
src/tools
directory -
Create and implement the
index.ts
,schema.ts
, andyour-tool.test.ts
files, which is the entry point, schema, and test file for the new tool respectively.The
export
ofindex.ts
file should be aToolRegistration
object, which is the registration of the new tool.If you want to add new Cadence files for your new tool, you can add them in the
src/cadence
directory. Thebun
will compile the Cadence files intoString
, so the dedicated Cadence files will help the project to be more organized.And it is recommended to add a test for your new tool in the
src/tools/your-tool-name/your-tool.test.ts
file. -
Add a prompt export in the
src/prompts
directory which is used to ensure MCP client can understand the new tool. You can refer to the existing tools for examples. -
Add your new tool to the
src/tools/index.ts
file. -
Run the test to ensure your new tool works as expected
-
Commit and push your changes to your forked repository, and create a pull request.
We will review your pull request and merge it if it is ready.