Skip to main content

MCP server for an Online Judge

Project description

Online Judge MCP Server

Python Version PyPI License

This is a Model Context Protocol (MCP) server that provides AI agents with tools to interact with an Online Judge API.

Features

Provides the following tools:

  • list_problems(offset, limit): List available problems on the OJ.
  • list_my_submissions(offset, limit): List recent submissions made by the authenticated user.
  • get_problem_details(problem_id): Fetch detailed descriptions, samples, limits, and rules of a problem.
  • submit_code(problem_id, code, language): Submit source code to a specific problem.
  • get_submission_status(submission_id): Check the polling status of a code submission.

Quickstart

Using uvx (Recommended)

The easiest way to run this server is using uvx, which automatically downloads the correct Python version, creates an ephemeral environment, and runs the tool seamlessly:

set OJ_URL="http://localhost:8000" # Replace with actual OJ URL
set OJ_USERNAME="your-username"
set OJ_PASSWORD="your-password"

uvx oj-mcp-server

Using pip or pipx

Alternatively, you can install the package directly into your Python environment:

pip install oj-mcp-server
oj-mcp-server

Usage with MCP Clients

To use this server, add it to your MCP client's configuration (e.g., Claude Desktop, Cursor, Cline).

Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "oj-mcp-server": {
      "command": "uvx",
      "args": ["oj-mcp-server"],
      "env": {
        "OJ_URL": "http://localhost:8000",
        "OJ_USERNAME": "your-username",
        "OJ_PASSWORD": "your-password"
      }
    }
  }
}

Note: If you installed globally via pip, simply change "command" to "oj-mcp-server" and "args" to [].

Cursor & Cline

In the MCP settings panel, add a new server:

  • Type: command
  • Name: oj-mcp-server
  • Command: uvx oj-mcp-server (or oj-mcp-server if installed via pip)
  • Environment: Set OJ_URL, OJ_USERNAME, and OJ_PASSWORD

OpenCode

Add this configured server inside your opencode.json (under the mcp key):

{
  "mcp": {
    "oj-mcp-server": {
      "type": "local",
      "command": ["uvx", "oj-mcp-server"],
      "environment": {
        "OJ_URL": "http://localhost:8000",
        "OJ_USERNAME": "your-username",
        "OJ_PASSWORD": "your-password"
      }
    }
  }
}

Note: If using pip, change the command array to ["oj-mcp-server"].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oj_mcp_server-0.1.1.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oj_mcp_server-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file oj_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: oj_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oj_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2de360f2b89f7295b5044030e4e36c2c9021008636570232e36c99bdde5ecbc
MD5 b883ac3a657b99eda6168d744c69ed56
BLAKE2b-256 a4c6773ca1ba8de1d8bf017e36a8e0ad5d58886e31bd3b9fe7f4a995b3319a91

See more details on using hashes here.

File details

Details for the file oj_mcp_server-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: oj_mcp_server-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for oj_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 953d0753a58b0ccf064897a06be86a74fe1bb0580ae46dd970b09a41d4916855
MD5 81c326650134b63a8f1cde47a79e8188
BLAKE2b-256 3ad0b52ba454c6b1f74d52df2559cc57735e08d1d8dcfcd8ab9606188e2b6f34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page