8000 GitHub - nalbion/go-mcp: Model Context Protocol client & server in Go
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ go-mcp Public

Model Context Protocol client & server in Go

Notifications You must be signed in to change notification settings

nalbion/go-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model Context Protocol

The code here was adapted from the kotlin-sdk and typescript-sdk.

See also https://modelcontextprotocol.io/introduction

MCP Client

When creating a Client, list it's capabilities, and then client.Connect(transport) connects to the Transport (through Protocol which it extends) and starts the initialize process.

You can then call client.ListTools(), CallTool() etc.

MCP Server

Creating a Server is similar to creating a Client - define its capabilities and call server.Connect(transport) and it will start listening for messages through the Transport.

JSON RPC

The Transport classes and Protocol are independant of MCP and could also be used for LSP client/servers etc.

JSON RCP Transport

The Transport class and it's client/server implementations for stdio, sse, in_memory know nothing about MCP. The role of the Transport interface is to simply send/receive JSON RPC messages, it does not format/parse messages, that's the role of Protocol.

JSON RPC Protocol

The Protocol class is provided for formatting and parsing JSON into Request/Response/Notification/Error messages and delegates the send/receive to Transport.

About

Model Context Protocol client & server in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0