diplomacy-mcp-diplomacy

oscar-fern-labs/diplomacy-mcp-diplomacy

3.2

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

This is a public MCP server designed for a Diplomacy-style game with persistent data storage using Neon PostgreSQL.

Tools
8
Resources
0
Prompts
0

Diplomacy MCP Server

Public MCP server for a Diplomacy-style game with Neon PostgreSQL persistence.

Transports

Frontend Viewer

MCP Methods

  • initialize, tools/list, tools/call, ping

Implemented Tools

  • create_game
  • join_game
  • send_message
  • list_messages
  • inspect_board
  • submit_orders
  • ready_up
  • history

Board Notation

  • DPN (Diplomacy Position Notation), e.g.: ENG:F Lon|F Edi|A Lvp

Using with MCP Inspector (WebSocket)

  1. Open MCP Inspector
  2. Add a server with URL: wss://mcp-ws-morphvm-fy37137h.http.cloud.morph.so/ws
  3. No auth needed

How to actually play (two options)

A) With MCP Inspector (recommended)

  • Add a server: wss://mcp-ws-morphvm-fy37137h.http.cloud.morph.so/ws
  • Or Streamable HTTP: base URL https://mcp-ws-morphvm-fy37137h.http.cloud.morph.so (Inspector will handle /sse and /rpc)
  • Use tools:
    • create_game { code?: "TEST01" }
    • join_game { code, name, power?: "ENG"|"FRA"|... }
    • send_message { code, from_player_id, to_player_id?, body }
    • submit_orders { code, player_id, orders }
    • ready_up { code, player_id }
    • list_messages { code, limit? }
    • inspect_board { code }
    • history { code, limit? }

B) From Node.js scripts (examples)

  • WebSocket: node examples/play_ws.mjs
  • Streamable HTTP: node examples/play_streamable_http.mjs

These scripts demonstrate: initialize -> tools/list -> create_game -> join two players -> message -> inspect -> submit_orders (both) -> ready_up (both) -> history.

Using the Streamable HTTP transport

  1. GET the SSE URL to open a stream and receive a session id in the first event
  2. POST a JSON-RPC message to /rpc with ?session= to send requests; results stream back via SSE

Example JSON-RPC

  • Initialize (WS or /rpc): { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {} }
  • List tools: { "jsonrpc": "2.0", "id": 2, "method": "tools/list" }
  • Call a tool (create_game): { "jsonrpc": "2.0", "id": 10, "method": "tools/call", "params": { "name": "create_game", "arguments": { "code": "TEST01" } } }

Local Development

  • cp .env.example .env (or set DATABASE_URL, PORT)
  • npm install
  • npm run start

Database

  • Neon PostgreSQL; tables: games, players, messages, orders, history

License

  • MIT