MCP-toolkit is used in a client-server architecture, the client typically being an agentic AI, and the server typically being an MCP server in Clojure.
The namespace mcp-toolkit.client
is for implementing a MCP client, it is designed to communicate with a MCP server.
The namespace mcp-toolkit.server
is for implementing a MCP server, it is designed to communicate with a MCP client.
If you want to implement a MCP proxy, you can use both.
The API design is the same in both namespaces:
session
.context
contains the session
and a few other things related to interfacing with the transport layout.context
is passed as the first parameter of most of functions in the API.session
contains some callbacks which are called when receiving certain kind of messages from the MCP protocol.
By default some of the callbacks are pointing to provided function which implement a default behavior.
If the user wants to customize the behavior, s/he can do it at the creation of the session value.:result
to the caller, or
to return a Promesa promise which will resolve to that value later, asynchronously.Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close