
viant/mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP is a Go implementation of the Model Context Protocol — a standardized way for applications to communicate with AI models.
Обзор
MCP is a Go implementation of the Model Context Protocol — a standardized way for applications to communicate with AI models.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP (Model Context Protocol) for Go
MCP is a Go implementation of the Model Context Protocol — a standardized way for applications to communicate with AI models. It allows developers to seamlessly bridge applications and AI models using a lightweight, JSON-RPC–based protocol.
This repository provides the Go MCP client/server runtime, bridge, and auth helpers. Protocol definitions and schemas live in mcp-protocol.
Official Model Context Protocol Specification
Overview
MCP (Model Context Protocol) is designed to provide a standardized communication layer between applications and AI models. The protocol simplifies the integration of AI capabilities into applications by offering a consistent interface for resource access, prompt management, model interaction, and tool invocation.
Key features:
- JSON-RPC 2.0–based communication
- Support for multiple transport protocols (HTTP/SSE, stdio)
- Server-side features:
- Resource management
- Model prompting and completion
- Tool invocation
- Subscriptions for resource updates
- Logging
- Progress reporting
- Request cancellation
- Client-side features:
- Roots
- Sampling
- Elicitation
Architecture
For detailed guides on custom server implementations and authentication, see docs/implementer.md and docs/authentication.md.
MCP is built around the following components:
- Transport: JSON-RPC over HTTP/SSE, streamable HTTP, or stdio
- Server: Handles incoming requests and dispatches to the protocol implementation
- Client: Makes requests to MCP-compatible servers
- Protocol Implementation (server.Handler): Provides the actual functionality behind each protocol method
High-Level Architecture
graph LR
Client[MCP Client] -->|JSON-RPC / HTTP/SSE| Server[MCP Server]
Server -->|Dispatches to| Handler[MCP Server]
subgraph Auth[Authentication / Authorization]
OAuth2[OAuth2 / OIDC]
end
Client -.->|Bearer Token| OAuth2
Server -.->|Token Validation| OAuth2
Getting Started
Installation
go get github.com/viant/mcp
If you just need to connect existing tools to a remote MCP server you might prefer to use the standalone Bridge binary instead of embedding the Go package. See Bridge Guide for details.
Creating a Server
Quick Start: Default Server
DefaultHandler can be used to quickly set up an MCP server. It provides no-op stubs for all methods, allowing you to focus on implementing only the methods you need. Register handlers inline without writing a custom server type:
package main
import (
"context"
"encoding/json"
"fmt"
"github.com/viant/jsonrpc"
"github.com/viant/mcp-protocol/schema"
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →