MCP ExplorerExplorer

Devvit Mcp

@redditon 10 months ago
3 BSD-3-Clause
FreeCommunity
AI Systems
MCP server for writing Devvit applications

Overview

What is Devvit Mcp

devvit-mcp is a companion MCP server designed for writing applications on Reddit’s developer platform. It is currently under active development, and all APIs are considered experimental.

Use cases

Use cases for devvit-mcp include building Reddit bots, creating tools for content moderation, developing applications for data analysis on Reddit interactions, and enhancing user engagement through automated responses.

How to use

To use devvit-mcp, add the specified configuration to your mcp.json file. Then, clone the repository, navigate to the devvit-mcp directory, use nvm to set the Node version, install dependencies, and run the development server.

Key features

Key features include an experimental API, integration with Reddit’s developer platform, and a focus on providing a robust debugging experience. It also emphasizes the importance of proper logging practices.

Where to use

devvit-mcp is primarily used in the development of applications that interact with Reddit’s API, making it suitable for developers looking to create bots, tools, or other integrations on the platform.

Content

devvit-mcp

A companion MCP server for writing applications on Reddit’s developer platform.

Installation

Add the following to your mcp.json for the editor or LLM of choice.

{
  "mcpServers": {
    "devvit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@devvit/mcp"
      ]
    }
  }
}

Opting Out Of Telemetry

{
  "mcpServers": {
    "devvit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@devvit/mcp"
      ],
      "env": {
        "DEVVIT_DISABLE_METRICS": "true"
      }
    }
  }
}

Developing on the MCP Server

git clone [email protected]:reddit/devvit-mcp.git

cd devvit-mcp

nvm use

npm install

npm run dev

If you want to test your MCP server inside of other projects. Pass in the entire path to your node runtime and the location of /dist/index.js on your machine.

  • Node path: which node
  • Dist: pwd from the root of your devvit-mcp + /dist/index.js
{
  "mcpServers": {
    "devvit-mcp": {
      "command": "/Users/marcus.wood/.nvm/versions/node/v22.13.0/bin/node",
      "args": ["/Users/marcus.wood/open-source/devvit-mcp/dist/index.js"]
    }
  }
}

MCP Gotchas

  • Never put a console.log in the hot path of your app if you’re trying to debug. You’ll see weird error messages like Unexpected token 'a', " at Anthrop"... is not valid JSON. We’ve shimmed logger to automatically handle this conversion for you.
  • Only log console.error in your MCP when running through MCP.

Debugging

  • Using npm run dev, going to tools, listing them out, and triggering is the best experience.

  • To test this live with logs, use Claude desktop and connecting the MCP there. They have log files that report errors on your machine. You can view them by opening in VSCode or running tail commands.

  • If you see something like this:

Error: Server does not support logging (required for notifications/message)
    at Server.assertNotificationCapability

You need to add the capability to your new MCPServer. Use this permalink to know what key you should add.

Credits

Huge thanks to Arabold for open sourcing docs-mcp-server. Portions of this code is heavily inspired by this library. Please use it if you need other docs servers!

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers