mcpserver

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mcpserver exposes Synapse's agent tool catalog to external AI clients over the Model Context Protocol. It is a hand-rolled MCP core – JSON-RPC 2.0 over the Streamable-HTTP transport (a single POST endpoint) implementing initialize / tools/list / tools/call – so it needs no third-party SDK and is fully testable offline. (The SDK can be swapped in later behind the same Catalog seam.)

Safety: the server is bearer-locked (role "mcp") and pinned to ONE engagement, so it can never reach another engagement's data (the catalog is engagement-locked per session and an engagement id is never accepted from the client). It dispatches through the SAME agenttools.Catalog the in-process orchestrator uses, so read tools return data and an execute proposal (start_recon) is returned as an approval-required envelope – the MCP path has no executor and no gate, so it can never RUN a tool (it can only read + propose). All dispatches are audited by the catalog under the agent id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is an MCP endpoint over a fixed engagement.

func New

func New(catalog *agenttools.Catalog, engagementID shared.ID, token, version string, log *slog.Logger) (*Server, error)

New validates dependencies and returns an MCP server bound to one engagement.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the MCP HTTP handler. Bearer-token auth gates every request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL