0.0.3 • Published 6 months ago

@onecompiler/onecompiler-mcp-server v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
6 months ago

MCP Server for Onecompiler

Onecompiler takes care of executing code with one unified API that does it all.

This is a Model Context Protocol (MCP) server that provides tools for interacting with the Onecompiler APIs.

Features

  • Execute code in Onecompiler

Installation

To use the MCP server, you'll need an API key. You can create and manage API keys in RapidAPI > OneCompiler APIs:

You can run the Onecompiler MCP server using npx with the following command:

npx -y @onecompiler/onecompiler-mcp-server --api-key=ONECOMPILER_API_KEY --provider=rapidapi

Replace ONECOMPILER_API_KEY with your API key retrieved from rapidapi

If you have retrieved your API key from onecompiler instead of rapidapi, you can run the server using the following command:

npx -y @onecompiler/onecompiler-mcp-server --api-key=ONECOMPILER_API_KEY --provider=onecompiler

To run the server in a client like Claude Desktop, Cursor, Cline or Windsurf, add the following to your MCP config:

{
  "mcpServers": {
    "onecompiler": {
      "command": "npx",
      "args": ["-y", "@onecompiler/onecompiler-mcp-server", "--api-key=ONECOMPILER_API_KEY", "--provider=rapidapi"]
    }
  }
}

or pass as values in env variables, example:

{
  "mcpServers": {
    "onecompiler": {
      "command": "npx",
      "args": ["-y", "@onecompiler/onecompiler-mcp-server"],
      "env": {
        "ONECOMPILER_API_KEY": "your_api_key",
        "ONECOMPILER_PROVIDER": "rapidapi"
      }
    }
  }
}

For detailed setup guides, see:

Development

  1. Install dependencies:

    npm install
  2. Build the server:

    npm build
  3. Update client to use the local build:

    {
      "mcpServers": {
        "onecompiler": {
          "command": "node",
          "args": ["path/to/onecompiler-mcp-server/build/index.js"],
          "env": {
            "ONECOMPILER_API_KEY": "your_api_key",
            "ONECOMPILER_PROVIDER": "(rapidapi | onecompiler)",
            "ONECOMPILER_ENVIRONMENT": "(sandbox | production)"
          }
        }
      }
    }

Note: Use ONECOMPILER_ENVIRONMENT, only if ONECOMPILER_PROVIDER is set to onecompiler.

Debugging

To debug the MCP server, you can use the MCP Inspector tool:

  1. Run the server with the inspector:

    pnpm inspector
  2. Open the provided URL in your browser to view and debug the MCP requests and responses.

  3. Include the --api-key, --environment or --provider arguments.