mcp-server-client

BR1WA/mcp-server-client

3.2

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

A Java-based MCP server and client implementation using Spring Boot and Swagger UI.

mcp-server-client

A simple demonstration of a Java-based MCP (Model Context Protocol) server and client implementation. The server uses Spring Boot and exposes MCP-compliant endpoints, while the client uses standard Java and supports full UI testing via Swagger.

✨ Features

  • Spring Boot Server: Hosts MCP-compatible endpoints over JSON-RPC
  • Java Client: Sends A2A and MCP requests
  • Postman Testing: Built-in support for Postman requests via JSON-RPC
  • Swagger UI: Fully interactive UI for testing client interactions

šŸš€ Quick Start

Prerequisites

  • Java 17+
  • Maven
  • Postman (optional, for server testing)
  • Browser (for Swagger UI testing)

Clone & Build

# Clone the repo
git clone https://github.com/BR1WA/mcp-server-client.git
cd mcp-server-client

# Build all modules
mvn clean install

Run the Server

cd server
mvn spring-boot:run

Server runs at: http://localhost:8877/

Run the Client

cd client
mvn spring-boot:run

Swagger UI available at: http://localhost:8086/swagger-ui/index.html

šŸ”§ Testing

āœ… Server via Postman

The server supports MCP requests directly. You can test using Postman:

Example MCP Request:

POST http://localhost:8877/
Content-Type: application/json
{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "params": {},
  "id": 1
}

You can also test other methods like tools/call, initialize, etc.

āœ… Client via Swagger UI

Once the client is running, visit:

http://localhost:8086/swagger-ui/index.html

Use the interactive page to:

  • Send messages
  • Trigger prompts
  • Simulate A2A or MCP message flows

šŸ“‚ Project Structure

mcp-server-client/
ā”œā”€ā”€ mcp-clit/        # Java client with Swagger UI
ā”œā”€ā”€ mcp-server/        # Spring Boot MCP server
ā”œā”€ā”€ pom.xml        # Parent Maven file
└── README.md

šŸ™Œ Author

BR1WA