Skip to content
Verified official

GitHub MCP

v2.1.0 changelog · 6

io.github.github/github-mcp-server

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

transport:streamable-http runtime:oci license:MIT tools:10

Target client

run in your project directory

claude mcp add --transport http github-mcp-server https://api.githubcopilot.com/mcp/

setup guides: Claude Code Claude Desktop Cursor VS Code Zed Windsurf Cline Gemini CLI Grok ChatGPT Claude.ai LangChain

Adds it for this project only. Append --scope user to make it available everywhere. Claude Code docs

get_me Read-only

get me

search_repositories Read-only

search repositories

get_file_contents Read-only

get file contents

list_issues Read-only

list issues

create_issue Mutating

create issue

list_pull_requests Read-only

list pull requests

create_pull_request Mutating

create pull request

get_pull_request_diff Read-only

get pull request diff

search_code Read-only

search code

list_commits Read-only

list commits

All 10 tools, one page each

Mutating and Read-only are read off each tool's name, not its schema — a hint, not a guarantee. Check the server's own documentation before granting access.

Technical article

Generated September 19, 2026

MCP Protocol Architecture & Design: Deep Technical Dive

Introduction

The Model Context Protocol (MCP) represents a fundamental rethinking of how AI systems interact with external tools and data. This comprehensive technical guide explores the protocol’s architecture, design decisions, and implementation patterns used by leading organizations.

Part 1: Protocol Fundamentals

1.1 Core Design Philosophy

MCP was designed around five core principles:

Simplicity: Uses JSON-RPC 2.0, a well-established standard. This reduces implementation complexity and enables rapid adoption across diverse platforms and programming languages.

Interoperability: Not vendor-locked. A server built for Claude works seamlessly with Cursor, and future clients can adopt without reinvention.

Composability: Clients can attach multiple servers, composing capabilities dynamically. Tools from one server work alongside tools from another without conflicts.

Security: Authentication, authorization, and audit trails are built into the protocol, not afterthoughts. Credentials never pass to the model directly.

Extensibility: New capabilities can be added without breaking existing implementations. The protocol includes versioning and capability negotiation.

1.2 Architectural Overview

┌─────────────────────────────────┐
│  AI Model (Claude/etc.)         │
│  (Reasoning, tool selection)    │
└────────────┬────────────────────┘
             │ Tool Calls (JSON-RPC)
             │
┌────────────▼────────────────────┐
│  MCP Client                     │
│  • Tool discovery               │
│  • Capability negotiation       │
│  • Request/Response handling    │
│  • Authentication management    │
└────────────┬────────────────────┘
             │ JSON-RPC Protocol
             │ (Multiple transports)
┌────────────▼────────────────────┐
│  MCP Server                     │
│  • Tool registration            │
│  • Request handlers             │
│  • Resource management          │
│  • Permission enforcement       │
└────────────────────────────────┘
             │
┌────────────▼────────────────────┐
│  External Systems               │
│  (GitHub, Stripe, Databases)    │
└─────────────────────────────────┘

1.3 Message Flow

A typical MCP interaction follows this sequence:

  1. Initialization: Client sends initialization message with protocol version and capabilities
  2. Discovery: Server responds with available tools, resources, and prompts
  3. Tool Call: Client requests tool execution with arguments
  4. Processing: Server executes tool and collects result
  5. Response: Server returns result in standardized format
  6. Integration: Client passes result to model for reasoning

Part 2: Protocol Specification

2.1 Message Format

All MCP messages follow JSON-RPC 2.0 format:

{
  "jsonrpc": "2.0",
  "id": "unique-request-id",
  "method": "method_name",
  "params": {
    "param1": "value1",
    "param2": "value2"
  }
}

Response format:

{
  "jsonrpc": "2.0",
  "id": "unique-request-id",
  "result": {
    "status": "success",
    "data": {}
  }
}

Error response:

{
  "jsonrpc": "2.0",
  "id": "unique-request-id",
  "error": {
    "code": -32600,
    "message": "Invalid Request",
    "data": {
      "details": "Additional error context"
    }
  }
}

2.2 Core Methods

tools/list: Server advertises available tools

  • Returns array of tool definitions
  • Includes name, description, input schema
  • Includes output schema and error handling

tools/call: Client requests tool execution

  • Sends tool name and arguments
  • Server validates arguments against schema
  • Returns result or error

resources/list: Server advertises accessible resources

  • Returns array of resource definitions
  • Includes resource names, descriptions, types

prompts/list: Server advertises reusable prompts

  • Returns prompt templates with placeholders
  • Includes instructions and best practices

Part 3: Transport Mechanisms

3.1 Stdio Transport

For local server processes:

  • Server runs as subprocess on client machine
  • Communication via stdin/stdout
  • Process isolation for security
  • Used by npm/pip/docker packages

Advantages:

  • Zero network overhead
  • File system access for local tools
  • Simple debugging

Disadvantages:

  • Single client per process
  • Machine-specific
  • Requires local runtime

3.2 HTTP/Streamable-HTTP Transport

For remote servers:

  • Client connects via HTTPS
  • Server runs on dedicated host
  • Multiple clients can connect
  • Streaming responses for long operations

Advantages:

  • Multiple concurrent clients
  • Centralized updates
  • Works across network boundaries

Disadvantages:

  • Network latency
  • Data leaves client machine
  • More infrastructure required

3.3 Custom Transports

The protocol is transport-agnostic:

  • WebSockets for real-time bidirectional communication
  • gRPC for high-performance scenarios
  • Message queues for async workflows
  • File-based for batch operations

Part 4: Tool System

4.1 Tool Definition

Tools require comprehensive schema:

{
  "name": "create_issue",
  "description": "Create a new GitHub issue with title and body",
  "inputSchema": {
    "type": "object",
    "properties": {
      "owner": {
        "type": "string",
        "description": "Repository owner"
      },
      "repo": {
        "type": "string",
        "description": "Repository name"
      },
      "title": {
        "type": "string",
        "description": "Issue title"
      },
      "body": {
        "type": "string",
        "description": "Issue description"
      }
    },
    "required": ["owner", "repo", "title"]
  },
  "outputSchema": {
    "type": "object",
    "properties": {
      "issue_id": {"type": "integer"},
      "issue_url": {"type": "string"},
      "created_at": {"type": "string"}
    }
  }
}

4.2 Tool Categories

Read-only Tools:

  • Fetch information
  • Search and query
  • List operations
  • No side effects

Write Tools:

  • Create resources
  • Update existing data
  • Delete operations
  • Has side effects

Long-running Tools:

  • Async operations
  • Batch processing
  • Background tasks
  • Progress tracking

Part 5: Security Architecture

5.1 Authentication

Multiple authentication strategies:

API Keys: Simple, stateless, suitable for HTTP servers

OAuth2: Third-party delegation, user-specific access

Mutual TLS: Certificate-based, high security

Custom Schemes: Domain-specific authentication

5.2 Authorization

Tool-level access control:

  • Administrators define allowed tools per client
  • Scopes limit what each tool can do
  • Rate limiting prevents abuse
  • Audit logging tracks all operations

5.3 Data Security

Credential handling best practices:

  • Credentials stored in client, never sent to model
  • Environment variables for sensitive configuration
  • Encryption for credential storage
  • Secure transmission (TLS, etc.)

Part 6: Resource System

6.1 Resource Types

Servers can expose multiple resource types:

File Resources:

  • Individual files
  • Directory listings
  • Large file handling

API Resources:

  • JSON data
  • Structured records
  • Database records

Stream Resources:

  • Real-time data feeds
  • Log files
  • Event streams

6.2 Resource Caching

Optimization strategies:

  • Client-side caching (1 hour default)
  • Server-side caching (as appropriate)
  • Cache invalidation patterns
  • Stale-while-revalidate

Part 7: Prompt System

7.1 Prompt Templates

Reusable interaction patterns:

{
  "name": "code_review",
  "description": "Template for reviewing code changes",
  "template": "Review the following code change for:\n1. Correctness\n2. Performance\n3. Security\n4. Best practices\n\nCode:\n{code}",
  "placeholders": ["code"],
  "best_practices": [
    "Provide specific feedback",
    "Suggest alternatives",
    "Explain reasoning"
  ]
}

7.2 Prompt Distribution

How prompts reach the model:

  • Server lists available prompts
  • Client selects and formats prompt
  • Model receives structured prompt
  • Results capture best practices

Part 8: Error Handling

8.1 Error Codes

Standard MCP error codes:

  • -32600: Invalid Request
  • -32601: Method not found
  • -32602: Invalid params
  • -32603: Internal error
  • -32000 to -32099: Server-specific errors

8.2 Error Recovery

Graceful degradation strategies:

  • Retry with backoff for transient failures
  • Fallback to alternative tools
  • Partial results when possible
  • Clear error messages for the model

Part 9: Performance Considerations

9.1 Latency Optimization

Reducing round-trip time:

  • Batch operations when possible
  • Connection pooling
  • Response caching
  • Async operations

9.2 Throughput

Handling high load:

  • Concurrent client connections
  • Request queuing
  • Rate limiting
  • Load balancing

9.3 Resource Management

Efficient resource usage:

  • Connection timeouts
  • Memory management for large responses
  • Streaming for big data
  • Cleanup of unused resources

Part 10: Versioning and Evolution

10.1 Protocol Versioning

How the protocol evolves:

  • Semantic versioning (major.minor.patch)
  • Capability negotiation for features
  • Backward compatibility maintained
  • Deprecation warnings for changes

10.2 Server Evolution

Updating server implementations:

  • New tools added without breaking changes
  • Tool schemas can be extended
  • New resource types supported
  • Transport improvements

Conclusion

The Model Context Protocol represents a mature approach to connecting AI systems with external capabilities. Its design principles—simplicity, interoperability, security, and extensibility—enable rapid adoption while maintaining quality and safety.

Understanding MCP’s architecture helps implementers make better decisions about server design, tool organization, and integration patterns.


Full technical guide: 20,000+ words covering protocol specification, transport mechanisms, tool systems, resource management, security architecture, error handling, performance optimization, and real-world implementation patterns.