Class McpStdioServer
java.lang.Object
com.github.thought2code.mcp.annotated.server.McpServerBase
com.github.thought2code.mcp.annotated.server.McpStdioServer
- All Implemented Interfaces:
McpServer
MCP server implementation for Standard Input/Output (STDIO) mode.
This class extends McpServerBase and provides an MCP server implementation that uses
standard input/output for communication. STDIO mode is the default mode for CLI tools and allows
the server to communicate through standard input and output streams.
STDIO mode is suitable for:
- Command-line interface (CLI) applications
- Integration with shell scripts and pipelines
- Simple communication scenarios where HTTP is not required
The server uses the standard input stream for receiving requests and the standard output stream for sending responses, making it easy to integrate with existing command-line tools.
- Author:
- codeboyzhou
- See Also:
-
McpServerBaseMcpSseServerMcpStreamableServerStdioServerTransportProvider
-
Field Summary
Fields inherited from class com.github.thought2code.mcp.annotated.server.McpServerBase
configuration -
Constructor Summary
ConstructorsConstructorDescriptionMcpStdioServer(McpServerConfiguration configuration) Constructs a newMcpStdioServerwith the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionio.modelcontextprotocol.server.McpServer.SyncSpecification<?>Creates and returns a synchronization specification for STDIO mode.Methods inherited from class com.github.thought2code.mcp.annotated.server.McpServerBase
createSyncServer, defineCapabilities, registerComponents
-
Constructor Details
-
McpStdioServer
Constructs a newMcpStdioServerwith the specified configuration.- Parameters:
configuration- the server configuration
-
-
Method Details
-
createSyncSpecification
public io.modelcontextprotocol.server.McpServer.SyncSpecification<?> createSyncSpecification()Creates and returns a synchronization specification for STDIO mode.This method creates an
McpServer.SyncSpecificationthat uses standard input/output transport provider for communication. The transport provider is configured with the default JSON mapper for message serialization and deserialization.- Returns:
- a synchronization specification configured for STDIO transport
- See Also:
-
StdioServerTransportProviderMcpJsonMapper
-