AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Mcp Light

mcp-scorbo2-mcp-light · by scorbo2

An extremely lightweight MCP server implementation for Java applications.

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add mcp-scorbo2-mcp-light

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution Used
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-scorbo2-mcp-light)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mcp Light? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

mcp-light

What is this?

This is an academic/hobby project meant to help learn about the MCP protocol and how it works.

Project goals:

  • produce an extremely lightweight MCP server implementation for Java applications.
  • minimal third party dependencies! Only Jackson for the JSON handling.
  • implement a reasonable percentage of the MCP spec (enough to gain a better understanding of the protocol)
  • produce an actual, working, extensible MCP server that could actually be used in a real application.
  • at an absolute bare minimum, it should be possible to connect with MCP Inspector, read resources, and call tools.

Basic usage

The generated jar file is executable, and comes with a very simple built-in example server implementation. To run it, simply clone the project, build with Maven/Java 25, and run the generated jar:

git clone https://github.com/scorbo2/mcp-light.git
cd mcp-light
mvn clean package
java -jar target/mcp-light-1.1.jar

# Or, start on a different port (default 8080):
java -jar target/mcp-light-1.1.jar 9090

This will start a very simple MCP server with the following features:

  • a tool called exampleTool that takes two dummy arguments and returns a fixed string.
  • a static resource at example://example/resource that returns a fixed string.
  • a templated resource at example://example/template/{id} that returns a string containing the id you provided.
  • an example prompt that accepts a topic argument
  • support for OPTIONS requests, allowing you to connect from browser-based clients such as llama-ui.
  • support for MCP "ping" requests.

Once the server is up and running, you should be able to connect to it from MCP Inspector to list the tools and resources. Or, you can wire up the server to some other MCP client.

Example connection: OpenCode

You can modify your ~/.config/opencode/opencode.json file to include a connection to your local MCP server:

{
  // existing opencode config here...
    
  "mcp": {
    "mcp-light": {
      "type": "remote",
      "url": "http://localhost:8080/mcp"
    }
  }
}

Now, when you start OpenCode, it should connect to your server. You can ask it to invoke tools, as in this example:

Prompt: Please call the `mcp-light_exampleTool` with an arg1 value of `hello` and report the results.                    

Thought: 388ms                                                                                                   
                                                                                                                  
The user wants me to call the mcp-light_exampleTool with arg1="hello".                                           
                                                                                                                  
⚙ mcp-light_exampleTool [arg1=hello]                                                                             
                                                                                                                  
Thought: 295ms                                                                                                   
                                                                                                                  
The tool executed successfully but didn't return much detail. Let me report the result to the user.              
                                                                                                                  
The mcp-light_exampleTool executed successfully. The tool returned a message: "Successfully executed the         
example tool!"

Using in code

The library is available in Maven Central, so you can just add it as a dependency in your project:


    ca.corbett
    mcp-light
    1.1

Once the library is imported into your Java project, you can implement the following interfaces as needed:

  • [McpTool](src/main/java/ca/corbett/mcp/McpTool.java) to define tools that can be called by clients.
  • [McpResource](src/main/java/ca/corbett/mcp/McpResource.java) to expose resources that clients can read.
  • [McpPrompt](src/main/java/ca/corbett/mcp/McpPrompt.java) to define prompts that clients can call.

Then, you can create an instance of [McpServer](src/main/java/ca/corbett/mcp/McpServer.java) and register your tools and resources to it before starting the server:

McpServer server = new McpServer();
server.registerTool(new MyTool());
server.registerResource(new MyResource());
server.registerPrompt(new MyPrompt());
server.start();

You should add code to ensure your server is stopped correctly. An easy way to do this is to add a shutdown hook:

Runtime.getRuntime().addShutdownHook(new Thread(server::stop));

Manual testing

While your server is up, you can use any REST client (like Bruno, Postman, or even curl) to send JSON-RPC requests to it, by manually specifying the request body. For example, to send an initialize request via curl:

curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": 1,
        "method": "initialize",
        "params": {
          "protocolVersion": "2024-11-05",
          "capabilities": {
            "roots": {
              "listChanged": true
            },
            "sampling": {}
          },
          "clientInfo": {
            "name": "ExampleClient",
            "version": "1.0.0"
          }
        }
      }'

This approach allows you to see the raw responses directly from your server, if you want to get a better look at what's happening under the hood.

But generally, testing with an actual client like MCP Inspector is just easier.

Is this production-grade?

No. This is a hobby project. Use it for fun and learning!

License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

More info

  • GitHub repo: https://github.com/scorbo2/mcp-light
  • Issues page: https://github.com/scorbo2/mcp-light/issues
  • MCP spec: https://modelcontextprotocol.io/specification/

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.