BR1WA/mcp-server-client
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