{
  "name": "github.com/l1fe-labs/forge-go/mcp",
  "language": "go",
  "version": "module source snapshot",
  "description": "Go mcp package.",
  "manifest": "forge-go/go.mod",
  "manifestSha256": "dee97864d07a64c4c93c79104137d155f0cbae6962945f3b56ceb7744a03cc82",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/go/mcp",
  "features": {},
  "files": [
    {
      "path": "forge-go/mcp/auth.go",
      "sha256": "abdab6515edf234a9a5d96cda0ef3c02babdc8b3afc150cbbdc1d946444bcfbf",
      "artifactSha256": "ee274f2ff6ba61bc69a17355578ce344b4db23c3e00d4202b0b5a8ace8c5831f",
      "url": "/reference/source/forge-go/mcp/auth.go.txt",
      "declarations": [
        {
          "name": "type OAuthConfig struct",
          "line": 15,
          "signature": "type OAuthConfig struct",
          "documentation": ""
        },
        {
          "name": "type PkceChallenge struct",
          "line": 40,
          "signature": "type PkceChallenge struct",
          "documentation": ""
        },
        {
          "name": "func GeneratePkceChallenge() (*PkceChallenge, error)",
          "line": 63,
          "signature": "func GeneratePkceChallenge() (*PkceChallenge, error)",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-go/mcp/client.go",
      "sha256": "d36d5568aade9c2b7312d1a5471403ffbdd828873635fe49d3384f2000a81cb4",
      "artifactSha256": "50a697f7924e78f9d2cd2c1ddc09ee9030f8fd4cd09e7462c5bb5ba81217892b",
      "url": "/reference/source/forge-go/mcp/client.go.txt",
      "declarations": [
        {
          "name": "type McpClientConfig struct",
          "line": 12,
          "signature": "type McpClientConfig struct",
          "documentation": ""
        },
        {
          "name": "type McpClient struct",
          "line": 29,
          "signature": "type McpClient struct",
          "documentation": ""
        },
        {
          "name": "func NewMcpClient(transport McpTransport, oauth *OAuthConfig) *McpClient",
          "line": 39,
          "signature": "func NewMcpClient(transport McpTransport, oauth *OAuthConfig) *McpClient",
          "documentation": ""
        },
        {
          "name": "func NewMcpClientFromConfig(config McpClientConfig) (*McpClient, error)",
          "line": 57,
          "signature": "func NewMcpClientFromConfig(config McpClientConfig) (*McpClient, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) Connect(ctx context.Context) (McpCapabilities, error)",
          "line": 81,
          "signature": "func (c *McpClient) Connect(ctx context.Context) (McpCapabilities, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) ListTools(ctx context.Context) ([]McpToolDescriptor, error)",
          "line": 138,
          "signature": "func (c *McpClient) ListTools(ctx context.Context) ([]McpToolDescriptor, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) CallTool(ctx context.Context, name string, arguments any) (json.RawMessage, error)",
          "line": 174,
          "signature": "func (c *McpClient) CallTool(ctx context.Context, name string, arguments any) (json.RawMessage, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) ListResources(ctx context.Context) ([]McpResource, error)",
          "line": 206,
          "signature": "func (c *McpClient) ListResources(ctx context.Context) ([]McpResource, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) GetResource(ctx context.Context, uri string) (json.RawMessage, error)",
          "line": 240,
          "signature": "func (c *McpClient) GetResource(ctx context.Context, uri string) (json.RawMessage, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) ListPrompts(ctx context.Context) ([]McpPrompt, error)",
          "line": 268,
          "signature": "func (c *McpClient) ListPrompts(ctx context.Context) ([]McpPrompt, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) GetPrompt(ctx context.Context, name string, arguments map[string]string) (json.RawMessage, error)",
          "line": 303,
          "signature": "func (c *McpClient) GetPrompt(ctx context.Context, name string, arguments map[string]string) (json.RawMessage, error)",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) Disconnect() error",
          "line": 324,
          "signature": "func (c *McpClient) Disconnect() error",
          "documentation": ""
        },
        {
          "name": "func (c *McpClient) Capabilities() McpCapabilities",
          "line": 331,
          "signature": "func (c *McpClient) Capabilities() McpCapabilities",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-go/mcp/error.go",
      "sha256": "be6e00003b1b970b5caf133ea185e266f8fefb67b997971e5f5c35ded2e3dd8c",
      "artifactSha256": "630d02004836bac8ee2cbcdbb0e2aed590f9cb34edd7fc868670ee481a6856d3",
      "url": "/reference/source/forge-go/mcp/error.go.txt",
      "declarations": [
        {
          "name": "type ErrKind string",
          "line": 17,
          "signature": "type ErrKind string\n\nconst (\n// ErrKindConnection indicates a connection establishment error.\nErrKindConnection ErrKind;",
          "documentation": ""
        },
        {
          "name": "type McpError struct",
          "line": 43,
          "signature": "type McpError struct",
          "documentation": ""
        },
        {
          "name": "func (e *McpError) Error() string",
          "line": 58,
          "signature": "func (e *McpError) Error() string",
          "documentation": ""
        },
        {
          "name": "func (e *McpError) Unwrap() error",
          "line": 66,
          "signature": "func (e *McpError) Unwrap() error",
          "documentation": ""
        },
        {
          "name": "func (e *McpError) Is(target error) bool",
          "line": 71,
          "signature": "func (e *McpError) Is(target error) bool",
          "documentation": ""
        },
        {
          "name": "func NewConnectionError(target, message string, cause error) *McpError",
          "line": 101,
          "signature": "func NewConnectionError(target, message string, cause error) *McpError",
          "documentation": ""
        },
        {
          "name": "func NewTransportError(operation, message string, cause error) *McpError",
          "line": 111,
          "signature": "func NewTransportError(operation, message string, cause error) *McpError",
          "documentation": ""
        },
        {
          "name": "func NewProtocolError(method, message string) *McpError",
          "line": 121,
          "signature": "func NewProtocolError(method, message string) *McpError",
          "documentation": ""
        },
        {
          "name": "func NewToolNotFoundError(toolName string) *McpError",
          "line": 130,
          "signature": "func NewToolNotFoundError(toolName string) *McpError",
          "documentation": ""
        },
        {
          "name": "func NewSerializationError(message string, cause error) *McpError",
          "line": 139,
          "signature": "func NewSerializationError(message string, cause error) *McpError",
          "documentation": ""
        },
        {
          "name": "func NewAuthError(message string, cause error) *McpError",
          "line": 148,
          "signature": "func NewAuthError(message string, cause error) *McpError",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-go/mcp/server.go",
      "sha256": "6a53a0c669c8cb47a79257395621b1aab7c0427a90c0da157a987d9fde870bc9",
      "artifactSha256": "c4ebf5f70b35a52a63e63f236e97ac242d5d8ac04b223485d1de3f1e3ce4d4bf",
      "url": "/reference/source/forge-go/mcp/server.go.txt",
      "declarations": [
        {
          "name": "type ToolHandler func(ctx context.Context, arguments json.RawMessage) (json.RawMessage, error)",
          "line": 17,
          "signature": "type ToolHandler func(ctx context.Context, arguments json.RawMessage) (json.RawMessage, error)\n\n// ResourceHandler is a function that handles an MCP resource read.\n//\n// Parameters:\n//   - ctx: context for cancellation and timeout\n//\n// Returns the resource content as raw JSON or an error.\ntype ResourceHandler func(ctx context.Context) (json.RawMessage, error)\n\n// PromptHandler is a function that handles an MCP prompt request.\n//\n// Parameters:\n//   - ctx: context for cancellation and timeout\n//   - arguments: the prompt arguments as key-value pairs\n//\n// Returns the rendered prompt as raw JSON or an error.\ntype PromptHandler func(ctx context.Context, arguments map[string]string) (json.RawMessage, error)\n\n// McpServerConfig configures an MCP server.\n//\n// ANVIL Spec Section 12.9 -- MCP Server Configuration.\ntype McpServerConfig struct",
          "documentation": ""
        },
        {
          "name": "type ResourceHandler func(ctx context.Context) (json.RawMessage, error)",
          "line": 25,
          "signature": "type ResourceHandler func(ctx context.Context) (json.RawMessage, error)\n\n// PromptHandler is a function that handles an MCP prompt request.\n//\n// Parameters:\n//   - ctx: context for cancellation and timeout\n//   - arguments: the prompt arguments as key-value pairs\n//\n// Returns the rendered prompt as raw JSON or an error.\ntype PromptHandler func(ctx context.Context, arguments map[string]string) (json.RawMessage, error)\n\n// McpServerConfig configures an MCP server.\n//\n// ANVIL Spec Section 12.9 -- MCP Server Configuration.\ntype McpServerConfig struct",
          "documentation": ""
        },
        {
          "name": "type PromptHandler func(ctx context.Context, arguments map[string]string) (json.RawMessage, error)",
          "line": 34,
          "signature": "type PromptHandler func(ctx context.Context, arguments map[string]string) (json.RawMessage, error)\n\n// McpServerConfig configures an MCP server.\n//\n// ANVIL Spec Section 12.9 -- MCP Server Configuration.\ntype McpServerConfig struct",
          "documentation": ""
        },
        {
          "name": "type McpServerConfig struct",
          "line": 39,
          "signature": "type McpServerConfig struct",
          "documentation": ""
        },
        {
          "name": "type McpServer struct",
          "line": 59,
          "signature": "type McpServer struct",
          "documentation": ""
        },
        {
          "name": "func NewMcpServer(config McpServerConfig) *McpServer",
          "line": 84,
          "signature": "func NewMcpServer(config McpServerConfig) *McpServer",
          "documentation": ""
        },
        {
          "name": "func (s *McpServer) RegisterTool(descriptor McpToolDescriptor, handler ToolHandler)",
          "line": 102,
          "signature": "func (s *McpServer) RegisterTool(descriptor McpToolDescriptor, handler ToolHandler)",
          "documentation": ""
        },
        {
          "name": "func (s *McpServer) RegisterResource(resource McpResource, handler ResourceHandler)",
          "line": 120,
          "signature": "func (s *McpServer) RegisterResource(resource McpResource, handler ResourceHandler)",
          "documentation": ""
        },
        {
          "name": "func (s *McpServer) RegisterPrompt(prompt McpPrompt, handler PromptHandler)",
          "line": 138,
          "signature": "func (s *McpServer) RegisterPrompt(prompt McpPrompt, handler PromptHandler)",
          "documentation": ""
        },
        {
          "name": "func (s *McpServer) HandleRequest(ctx context.Context, req *McpRequest) *McpResponse",
          "line": 159,
          "signature": "func (s *McpServer) HandleRequest(ctx context.Context, req *McpRequest) *McpResponse",
          "documentation": ""
        },
        {
          "name": "func (s *McpServer) Serve(ctx context.Context, transport McpTransport) error",
          "line": 192,
          "signature": "func (s *McpServer) Serve(ctx context.Context, transport McpTransport) error",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-go/mcp/transport.go",
      "sha256": "4b33971f31ffb853577999bcf544515ea6bae3308339fcb5c040b26bc0360806",
      "artifactSha256": "339a13ea7827ec3a79298333cc0c36dd91c63250f52ed04112820433c9940647",
      "url": "/reference/source/forge-go/mcp/transport.go.txt",
      "declarations": [
        {
          "name": "type TransportType string",
          "line": 18,
          "signature": "type TransportType string\n\nconst (\n// TransportTypeStdio uses standard input/output for communication.\nTransportTypeStdio TransportType;",
          "documentation": ""
        },
        {
          "name": "type TransportConfig struct",
          "line": 34,
          "signature": "type TransportConfig struct",
          "documentation": ""
        },
        {
          "name": "type McpTransport interface",
          "line": 52,
          "signature": "type McpTransport interface",
          "documentation": ""
        },
        {
          "name": "func CreateTransport(config TransportConfig) (McpTransport, error)",
          "line": 86,
          "signature": "func CreateTransport(config TransportConfig) (McpTransport, error)",
          "documentation": ""
        },
        {
          "name": "type StdioTransport struct",
          "line": 108,
          "signature": "type StdioTransport struct",
          "documentation": ""
        },
        {
          "name": "func NewStdioTransport(r io.Reader, w io.Writer) *StdioTransport",
          "line": 120,
          "signature": "func NewStdioTransport(r io.Reader, w io.Writer) *StdioTransport",
          "documentation": ""
        },
        {
          "name": "func (t *StdioTransport) Send(_ context.Context, data []byte) error",
          "line": 128,
          "signature": "func (t *StdioTransport) Send(_ context.Context, data []byte) error",
          "documentation": ""
        },
        {
          "name": "func (t *StdioTransport) Receive(_ context.Context) ([]byte, error)",
          "line": 146,
          "signature": "func (t *StdioTransport) Receive(_ context.Context) ([]byte, error)",
          "documentation": ""
        },
        {
          "name": "func (t *StdioTransport) Close() error",
          "line": 163,
          "signature": "func (t *StdioTransport) Close() error",
          "documentation": ""
        },
        {
          "name": "type SSETransport struct",
          "line": 178,
          "signature": "type SSETransport struct",
          "documentation": ""
        },
        {
          "name": "func NewSSETransport(url string) *SSETransport",
          "line": 189,
          "signature": "func NewSSETransport(url string) *SSETransport",
          "documentation": ""
        },
        {
          "name": "func (t *SSETransport) Send(ctx context.Context, data []byte) error",
          "line": 199,
          "signature": "func (t *SSETransport) Send(ctx context.Context, data []byte) error",
          "documentation": ""
        },
        {
          "name": "func (t *SSETransport) Receive(ctx context.Context) ([]byte, error)",
          "line": 227,
          "signature": "func (t *SSETransport) Receive(ctx context.Context) ([]byte, error)",
          "documentation": ""
        },
        {
          "name": "func (t *SSETransport) ConnectSSE(ctx context.Context) error",
          "line": 249,
          "signature": "func (t *SSETransport) ConnectSSE(ctx context.Context) error",
          "documentation": ""
        },
        {
          "name": "func (t *SSETransport) Close() error",
          "line": 303,
          "signature": "func (t *SSETransport) Close() error",
          "documentation": ""
        },
        {
          "name": "type HTTPTransport struct",
          "line": 315,
          "signature": "type HTTPTransport struct",
          "documentation": ""
        },
        {
          "name": "func NewHTTPTransport(url string) *HTTPTransport",
          "line": 324,
          "signature": "func NewHTTPTransport(url string) *HTTPTransport",
          "documentation": ""
        },
        {
          "name": "func (t *HTTPTransport) Send(ctx context.Context, data []byte) error",
          "line": 333,
          "signature": "func (t *HTTPTransport) Send(ctx context.Context, data []byte) error",
          "documentation": ""
        },
        {
          "name": "func (t *HTTPTransport) Receive(ctx context.Context) ([]byte, error)",
          "line": 365,
          "signature": "func (t *HTTPTransport) Receive(ctx context.Context) ([]byte, error)",
          "documentation": ""
        },
        {
          "name": "func (t *HTTPTransport) Close() error",
          "line": 382,
          "signature": "func (t *HTTPTransport) Close() error",
          "documentation": ""
        }
      ]
    },
    {
      "path": "forge-go/mcp/types.go",
      "sha256": "63ccddd93e8b1e9880013e01b910cff2203e97abfa6fe808661f72f56b08cb2d",
      "artifactSha256": "4179aa5a9ba1b43d3ceae4abd3aa154b5598cb059907f5f66931f85614f470eb",
      "url": "/reference/source/forge-go/mcp/types.go.txt",
      "declarations": [
        {
          "name": "type McpToolDescriptor struct",
          "line": 11,
          "signature": "type McpToolDescriptor struct",
          "documentation": ""
        },
        {
          "name": "type McpResource struct",
          "line": 25,
          "signature": "type McpResource struct",
          "documentation": ""
        },
        {
          "name": "type McpPrompt struct",
          "line": 42,
          "signature": "type McpPrompt struct",
          "documentation": ""
        },
        {
          "name": "type McpPromptArgument struct",
          "line": 54,
          "signature": "type McpPromptArgument struct",
          "documentation": ""
        },
        {
          "name": "type McpCapabilities struct",
          "line": 68,
          "signature": "type McpCapabilities struct",
          "documentation": ""
        },
        {
          "name": "func AllCapabilities() McpCapabilities",
          "line": 80,
          "signature": "func AllCapabilities() McpCapabilities",
          "documentation": ""
        },
        {
          "name": "func NoCapabilities() McpCapabilities",
          "line": 89,
          "signature": "func NoCapabilities() McpCapabilities",
          "documentation": ""
        },
        {
          "name": "func DefaultCapabilities() McpCapabilities",
          "line": 95,
          "signature": "func DefaultCapabilities() McpCapabilities",
          "documentation": ""
        },
        {
          "name": "type McpRequestID struct",
          "line": 102,
          "signature": "type McpRequestID struct",
          "documentation": ""
        },
        {
          "name": "func NumberID(n int64) McpRequestID",
          "line": 107,
          "signature": "func NumberID(n int64) McpRequestID",
          "documentation": ""
        },
        {
          "name": "func StringID(s string) McpRequestID",
          "line": 112,
          "signature": "func StringID(s string) McpRequestID",
          "documentation": ""
        },
        {
          "name": "func NullID() McpRequestID",
          "line": 117,
          "signature": "func NullID() McpRequestID",
          "documentation": ""
        },
        {
          "name": "func (id McpRequestID) Value() any",
          "line": 122,
          "signature": "func (id McpRequestID) Value() any",
          "documentation": ""
        },
        {
          "name": "func (id McpRequestID) MarshalJSON() ([]byte, error)",
          "line": 127,
          "signature": "func (id McpRequestID) MarshalJSON() ([]byte, error)",
          "documentation": ""
        },
        {
          "name": "func (id *McpRequestID) UnmarshalJSON(data []byte) error",
          "line": 132,
          "signature": "func (id *McpRequestID) UnmarshalJSON(data []byte) error",
          "documentation": ""
        },
        {
          "name": "type McpRequest struct",
          "line": 164,
          "signature": "type McpRequest struct",
          "documentation": ""
        },
        {
          "name": "func NewRequest(id McpRequestID, method string, params any) (*McpRequest, error)",
          "line": 186,
          "signature": "func NewRequest(id McpRequestID, method string, params any) (*McpRequest, error)",
          "documentation": ""
        },
        {
          "name": "type McpResponse struct",
          "line": 207,
          "signature": "type McpResponse struct",
          "documentation": ""
        },
        {
          "name": "func (r *McpResponse) IsError() bool",
          "line": 224,
          "signature": "func (r *McpResponse) IsError() bool",
          "documentation": ""
        },
        {
          "name": "type McpErrorObject struct",
          "line": 231,
          "signature": "type McpErrorObject struct",
          "documentation": ""
        },
        {
          "name": "func (e *McpErrorObject) Error() string",
          "line": 245,
          "signature": "func (e *McpErrorObject) Error() string",
          "documentation": ""
        }
      ]
    }
  ]
}
