Skip to content

prometheus-protocol/create-motoko-mcp-server

Repository files navigation

Create Motoko MCP Server

npm version License: MIT

The official command-line tool to bootstrap a new, production-ready Motoko MCP server for the Prometheus Protocol.

This tool generates a complete, batteries-included project so you can skip the boilerplate and focus on building your application's core logic.

Features

The generated project includes:

  • Complete Project Structure: A ready-to-use Motoko project with dfx.json and mops.json pre-configured.
  • Prometheus SDKs: All necessary ICRC standards (ICRC-126, ICRC-127, etc.) are included as dependencies.
  • Built-in NPM Scripts: Common tasks like deploying, testing, and starting a local replica are available out-of-the-box.
  • App Store Integration: Comes with @prometheus-protocol/app-store-cli as a dev dependency and pre-configured scripts for easy publishing.
  • Optional Auth: A commented-out code block to easily enable API keys and/or Prometheus OAuth for monetization.
  • Sample Tool: A simple "echo" tool to demonstrate the basic structure of an MCP server.
  • Self-Documenting: Generates a detailed README.md within your new project to guide you further.

Prerequisites

Before you begin, make sure you have the following tools installed:

  1. Node.js: Version 18.0 or higher. Download.
  2. DFX: The DFINITY Canister SDK. Installation Guide.
  3. MOPS: The Motoko Package Manager. Installation Guide.
  4. Git: The version control system. Download.

🚀 Usage (Quick Start)

To create a new project, run the following command in your terminal:

npx create-motoko-mcp-server my-awesome-app

This will create a new directory called my-awesome-app with the complete project structure.

Then, navigate into your new project and install the dependencies:

cd my-awesome-app
npm install
npm run mops:install

Your new server is now ready to be deployed!

What You Get

Your new project directory will have the following structure:

my-awesome-app/
├── src/
│   └── main.mo       <-- Your server's main logic lives here!
├── dfx.json          <-- DFINITY Canister SDK configuration
├── mops.json         <-- Motoko package manager configuration
├── package.json      <-- npm scripts and dependencies
└── README.md         <-- A detailed guide for your new project

Next Steps: Your Project's Journey

Once your project is created, the generated README.md inside my-awesome-app/ will guide you through the following steps:

  1. Deploy Locally:

    • npm run start (Starts the local replica)
    • npm run deploy (Deploys your canister)
  2. Test with the Inspector:

    • npm run inspector (Launches the MCP Inspector tool to test your server's functionality)
  3. Enable Monetization (Optional):

    • Uncomment the auth code in src/main.mo and redeploy.
    • Create an API key using dfx canister call <your_canister_name> create_my_api_key '("My Key", ["read", "write"])'.
    • (Optional) Register your server with the auth service using npm run auth register.
  4. Publish to the App Store:

    • npm run app-store init (Creates your prometheus.yml manifest)
    • npm run app-store -- publish --app-version "0.1.0" (Publishes your server for verification)

Contributing

Contributions to create-motoko-mcp-server are welcome! Please open an issue or submit a pull request on our GitHub repository.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published