Skip to content

PluMCP Server

As we saw in Quickstart the main entrypoint of PluMCP Server is function plumcp.core.api.mcp-server/run-server, which accepts several options.

Below are few common options (check source for exhaustive list):

  • :info (required) is MCP server info, may be constructed using plumcp.core.api.entity-support/make-info
  • :instructions (optional) is a text communicated by the server to the client
  • :transport (optional) is either :stdio (default) or :http
  • :runtime (optional) is derived from other args if unspecified
    • :capabilities (optional) is constructed from options below
      • :primitives (optional) is a map with keys :prompts, :resources, :tools, :callbacks
      • :vars (optional) is a vector of annotated var instances
      • :ns (optional, default: current namespace) is a vector of namespaces

Server capabilities

A PluMCP server makes use of server capabilities to deliver its features. There are several ways to expose server capabilities. While :primitives is the low-level way to specify capabilities, :vars and :ns allow the use of annotated vars to discover capabilities.

When you specify {:ns [myapp.foo myapp.bar]} it searches through all annotated vars in those namespaces to discover the primitives. Similarly, specifying {:vars [#'myapp.foo/baz #'myapp.bar/quux]} causes only those annotated vars to be scanned as primitives.

Runing an STDIO server

(plumcp.core.api.mcp-server/run-server
  {:info server-info
   :transport :stdio     ; optional
   :instructions "..."   ; optional
   :ns [app.foo app.bar] ; optional
   })

Running Streamable HTTP server

(plumcp.core.api.mcp-server/run-server
  {:info server-info
   :transport :http      ; implies Streamable HTTP server
   :instructions "..."   ; optional
   :ns [app.foo app.bar] ; optional
   })