Get the FREE Ultimate OpenClaw Setup Guide →

mcp-scala

Model Context Protocol server written in Scala

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio windymelt-mcp-scala sh /path/to/run.sh

How to use

MCP-scala is a Model Context Protocol server implemented in Scala 3 that communicates over a stdio transport. The server exposes a set of example tools such as randomNumber, iota, and sum, which can be invoked by an MCP client. These tools are defined in Scala with IO-based handlers and return content parts that the client can render or process. To use the server, deploy it behind a client that can start the provided stdio-based process and feed it MCP requests, receiving MCP responses through standard input and output streams. The README example shows how a client can configure the server in the MCP manifest and how the individual tools are registered in the tool handlers. You can also inspect Main.scala to see how tools are wired into the Handler and how individual tool functions return ContentPart sequences.

How to install

Prerequisites:

  • Java Development Kit (JDK 11+)
  • sbt (Scala Build Tool)

Installation steps:

  1. Clone the repository: git clone https://github.com/your-org/mcpscala.git cd mcpscala
  2. Ensure sbt is installed and available on PATH. Verify with: sbt --version
  3. Build the Scala project (the demo mentions building to a JS artifact via fastLinkJS): sbt example/fastLinkJS

    This compiles the Scala project and produces a JS artifact if the build is configured that way.

  4. Prepare the run script for stdio transport (example /path/to/run.sh):
    • Create a script that starts the MCP server process and communicates via STDIN/STDOUT as required by MCP stdio transport.
    • Ensure the script is executable: chmod +x /path/to/run.sh
  5. Run the server using the MCP manifest (example referenced in README):
    • Create an mcp_config.json like shown in the documentation (see mcp_config section).
    • Start the runner using your preferred launcher, or integrate with your MCP client as described in the docs.

Note: The README demonstrates a stdio-based integration where the server is launched through a shell command (sh /path/to/run.sh) and communicates using the stdio transport.

Additional notes

Tips and notes:\n- The mcpscala server uses stdio transport; ensure the run.sh script properly forwards input/output to the MCP client.\n- The example tool names (randomNumber, iota, sum) correspond to Scala implementations in Main.scala; new tools can be added by registering them in the handler mappings.\n- Timeout is set to 30 seconds in the example config; adjust as needed for longer-running tools.\n- If modifying environment variables, you may want to expose variables like TOOL_NAME, TOOL_TIMEOUT, or MODIFY_PATH for locating the run script.\n- Debug by inspecting logs from the run.sh script and ensuring the MCP client receives properly formatted MCP ContentParts in responses.

Related MCP Servers

Sponsor this space

Reach thousands of developers