Share My Creation Model Context Protocol (MCP) Server using Stdio

1765386143223.png

Github: https://github.com/pyhoon/mcp-server-b4j

Use Claude desktop to talk to the MCP server.
Sample claude_desktop_config.json attached.
 

Attachments

  • b4j_mcp_server.zip
    5 KB · Views: 9

aeric

Expert
Licensed User
Longtime User
We can simulate the "Client" by simply running the B4J app and typing these JSON strings into the console to test it.
Build the app in release and test using the following input in cmd:

1. Handshake (Initialize): Client sends:
JSON:
{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "TestClient", "version": "1.0"}}}
Server replies: Lists capabilities and server info.

2. List Tools: Client sends:
JSON:
{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}
Server replies: JSON defining get_inventory and add_product.

3. Call Tool (Query Database): Client sends:
JSON:
{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "get_inventory", "arguments": {}}}
Server replies: A JSON list of your SQLite rows!
 

aeric

Expert
Licensed User
Longtime User
Update your claude_desktop_config.json in C:\Users\<yourusername>\AppData\Roaming\Claude

JSON:
{
  "mcpServers": {
    "b4j-inventory": {
      "command": "Path/To/OpenJDK/bin/java",
      "args": [
        "-jar",
        "C:/Path/To/Your/mcp_server.jar"
      ]
    }
  }
}

and your MCP server will be available!

Restart the Claude desktop app if there is an error.

1765386687510.png


You can click the Greater Than button next to the switch to see available tools.
1765387037835.png


When you ask the AI Client, you will be asked to Allow it to proceed.
1765387595774.png


1765387754825.png


1765387863768.png
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
(πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―πŸ’―) * 10000
 

hatzisn

Expert
Licensed User
Longtime User
Are you successfully follow and run the server project?
Not yet. But I will try it a.s.a.p. Thank you for your effort.
 
Top