mcpa2a

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

nbrain-mcp-a2a-go

Zero-dependency Go 1.22+ Model Context Protocol (MCP JSON-RPC 2.0 Streamable HTTP) and Linux Foundation A2A v1.0 (/.well-known/agent-card.json, /.well-known/agents.json, /.well-known/mcp/server-card.json) server toolkit.

go get github.com/NBrain-Studio/nbrain-mcp-a2a-go@v1.0.0

Built by Eng. Nadeem Mohamed Badr El-Din (nadeembadr.com) & NBrain (nbra.in).

Documentation

Overview

Package mcpa2a implements a zero-dependency Go 1.22+ Model Context Protocol (MCP JSON-RPC 2.0) server and Linux Foundation A2A v1.0 well-known agent discovery toolkit (/.well-known/agent-card.json, /.well-known/agents.json, and /.well-known/mcp/server-card.json).

Built by Eng. Nadeem Mohamed Badr El-Din (https://nadeembadr.com/about/) & NBrain (https://nbra.in/).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A2ASkill

type A2ASkill struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
}

A2ASkill advertises a concrete delegatable capability.

type AgentCard

type AgentCard struct {
	ProtocolVersion string     `json:"protocolVersion"`
	Name            string     `json:"name"`
	Description     string     `json:"description"`
	URL             string     `json:"url"`
	Version         string     `json:"version"`
	Provider        Provider   `json:"provider"`
	Skills          []A2ASkill `json:"skills"`
}

AgentCard conforms to Linux Foundation A2A Protocol v1.0 /.well-known/agent-card.json.

type Provider

type Provider struct {
	Organization string `json:"organization"`
	URL          string `json:"url"`
}

Provider identifies the owning engineering organization.

type Server

type Server struct {
	Name    string
	Version string
	Origin  string
	Tools   map[string]Tool
	Card    AgentCard
}

Server serves MCP JSON-RPC 2.0 (/mcp) and A2A/MCP well-known discovery cards over net/http.

func NewServer

func NewServer(name, version, origin string) *Server

NewServer initializes an MCP + A2A v1.0 HTTP server.

func (*Server) Handler

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

Handler returns an http.Handler mounting /mcp, /.well-known/agent-card.json, /.well-known/agents.json, and /.well-known/mcp/server-card.json.

func (*Server) RegisterTool

func (s *Server) RegisterTool(t Tool)

RegisterTool adds an MCP tool and appends an A2A skill entry.

type Tool

type Tool struct {
	Name        string                                 `json:"name"`
	Description string                                 `json:"description"`
	InputSchema map[string]any                         `json:"inputSchema"`
	Handler     func(args map[string]any) (any, error) `json:"-"`
}

Tool describes an MCP callable tool with JSON Schema input parameters.

Jump to

Keyboard shortcuts

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