fates-draw

jneums/fates-draw

3.2

If you are the rightful owner of fates-draw and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

My Awesome MCP Server is a ready-to-deploy Motoko MCP server designed for the Prometheus Protocol ecosystem, providing a seamless integration for developers to create and manage MCP services.

Tools
1
Resources
0
Prompts
0

My Awesome MCP Server

This project was generated by create-motoko-mcp-server and provides a complete, ready-to-deploy Motoko MCP server for the Prometheus Protocol ecosystem.

This guide assumes you are using npm as your package manager.

Prerequisites

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

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

Part 1: Quick Start (Local Development)

This section guides you from zero to a working, testable MCP server on your local machine.

Step 1: Initialize Your Repository

The Prometheus publishing process is tied to your Git history. Initialize a repository and make your first commit now.

git init
git add .
git commit -m "Initial commit from template"

Step 2: Install Dependencies

This command will install both the required Node.js packages and the Motoko packages.

npm install
npm run mops:install

Step 3: Deploy Your Server Locally

  1. Start the Local Replica: (Skip this if it's already running)
    npm run start
    
  2. Deploy to the Local Replica: (In a new terminal window)
    npm run deploy
    

Step 4: Test with the MCP Inspector

Your server is live and its default get_weather tool is ready to use.

  1. Launch the Inspector:
    npm run inspector
    
  2. Connect to Your Canister: Use the local canister ID endpoint provided in the npm run deploy output.
    # Replace `your_canister_id` with the actual ID from the deploy output
    http://127.0.0.1:4943/mcp/?canisterId=your_canister_id
    

🎉 Congratulations! You have a working local MCP server.


Part 2: Enable Monetization

Ready to add paid tools? Follow these steps to enable authentication and test with an API key.

Step 1: Activate Monetization in Code

  1. Open src/main.mo.
  2. Uncomment the payment block inside the get_weather tool definition.
  3. Uncomment the allowanceUrl in the mcpConfig.
  4. Uncomment the large block of code that initializes the authContext.
  5. Save the file and run npm run deploy again to update your local canister.

Step 2: Generate and Test an API Key

With monetization active, your server can issue and validate API keys.

  1. Generate a Key: Use dfx to call your canister and create a key linked to your developer identity.

    # Replace <your_canister_id> with your local canister ID
    dfx canister call <your_canister_id> create_api_key '("My Test Key")'
    

    Save the returned key! This is the only time it will be shown.

  2. Test with MCP Inspector:

    • Open the MCP Inspector as before.
    • In the "Authorization" section, set the x-api-key header to the API key you just generated.
    • Call the get_weather tool again. It should now succeed, indicating that your monetization setup is working.

Step 3 (Optional): Enable Interactive Login

For user-facing web apps, you can enable the browser-based OAuth login flow.

npm run auth register

Part 3: Publish to the App Store (Deploy to Mainnet)

Instead of deploying to mainnet yourself, you publish your service to the Prometheus Protocol. The protocol then verifies, audits, and deploys your code for you.

Step 1: Commit Your Changes

Make sure all your code changes (like enabling monetization) are committed to Git.

git add .
git commit -m "feat: enable monetization"

Step 2: Publish Your Service

Use the app-store CLI to submit your service for verification and deployment.

# 1. Get your commit hash
git rev-parse HEAD
# 2. Run the init command to create your manifest
npm run app-store init 

Complete the prompts to set up your prometheus.yml manifest file. Add your commit hash and the path to your WASM file (found in .dfx/local/canisters/<your_canister_name>/<your_canister_name>.wasm).

# 3. Run the publish command with your app version
npm run app-store publish "0.1.0"

Once your service passes the audit, the protocol will automatically deploy it and provide you with a mainnet canister ID. You can monitor the status on the Prometheus Audit Hub.


Part 4: Managing Your Live Server

Treasury Management

Your canister includes built-in Treasury functions to securely manage the funds it collects. You can call these with dfx against your mainnet canister ID.

  • get_owner()
  • get_treasury_balance(ledger_id)
  • withdraw(ledger_id, amount, destination)

Updating Your Service (e.g., Enabling the Beacon)

Any code change to a live service requires publishing a new version.

  1. Open src/main.mo and uncomment the beaconContext.
  2. Commit the change: git commit -m "feat: enable usage beacon".
  3. Re-run the publishing process from Part 3 with the new commit hash.

What's Next?

  • Customize Your Tool: Open src/main.mo to start building your own custom MCP tools.
  • Learn More: Check out the full Service Developer Docs for advanced topics.