ModelContextProtocol (MCP) Java SDK v0.8.0 Specification
@jayessdeesea
关于 ModelContextProtocol (MCP) Java SDK v0.8.0 Specification
Instructions for an AI on how to create a Java based mcp server and client
基本信息
配置
工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is ModelContextProtocol (MCP) Java SDK v0.8.0 Specification?
The Model Context Protocol (MCP) is a standardized protocol for communication between AI models and external tools or resources. This Java SDK provides a robust implementation, enabling Java applications to create MCP servers that expose tools and resources to AI models, as well as MCP clients that communicate with these servers.
How to use ModelContextProtocol (MCP) Java SDK v0.8.0 Specification?
Add the MCP BOM to your project's dependency management, then include the core mcp artifact. Use the builder pattern to create a McpSyncClient or McpAsyncClient, providing a transport (e.g., StdioClientTransport) and client info. Then call methods like readResource, callTool, listPrompts, or getPrompt. Close the client after use.
Key features of ModelContextProtocol (MCP) Java SDK v0.8.0 Specification
- Modular architecture with separate transport, protocol, and error‑handling layers
- Synchronous (
McpSyncClient) and asynchronous (McpAsyncClient) client implementations - Server implementations (
McpSyncServer,McpAsyncServer) for exposing resources and tools - Built‑in support for stdio transport; HTTP/SSE transport via Jakarta Servlet API
- Type‑safe MCP schema classes and error utilities in dedicated packages
- Full support for reading resources, calling tools, and managing prompts
Use cases of ModelContextProtocol (MCP) Java SDK v0.8.0 Specification
- Build a Java MCP server that exposes file‑system resources and AI‑assistant tools
- Create a synchronous client that fetches resources and calls tools from an external MCP server
- Develop an asynchronous client for non‑blocking interactions with a remote MCP server
- List and retrieve prompt templates from a server to generate structured AI queries
FAQ from ModelContextProtocol (MCP) Java SDK v0.8.0 Specification
What is the difference between synchronous and asynchronous clients?
McpSyncClient blocks on each call, while McpAsyncClient returns Reactor Mono objects for non‑blocking operation and requires an explicit initialize().block() call.
What transports are supported out of the box?
The SDK includes StdioClientTransport for stdio‑based communication. HTTP/SSE transports require the jakarta.servlet-api dependency (version 5.0.0, scope provided).
What are the required dependencies?
Use the MCP BOM (mcp-bom:0.8.0) for version management, then add the core mcp artifact. For HTTP/SSE, include jakarta.servlet-api:5.0.0. Testing utilities are in the mcp-test artifact.
Can
开发工具 分类下的更多 MCP 服务器
nuxt-mcp / vite-plugin-mcp
antfuMCP server helping models to understand your Vite/Nuxt app better.
sentry-mcp
getsentryAn MCP server for interacting with Sentry via LLMs.
MCP Framework
QuantGeekDevThe Typescript MCP Framework
MCP-Scan: An MCP Security Scanner
invariantlabs-aiSecurity scanner for AI agents, MCP servers and agent skills.

Sentry
modelcontextprotocolModel Context Protocol Servers
评论