macOS / Linux β set your PAT in the environment
In the Protocol Archives, the ancient contracts are kept β the Model Context Protocol scrolls that allow agents to speak with systems beyond the Repository walls. Each MCP server is a Guild-certified interpreter, transforming the agent's structured requests into calls the external world understands. Without the Conclave's blessing, an agent that reaches beyond the Repository risks corruption, injection, or worse β unapproved data exfiltration.
πΊοΈ Quest Network Position¶
graph LR
Q4[β
Q4: Arsenal] --> Q5[π― Q5: MCP Conclave]
Q5 --> Q6[π Q6: Bind the Realm]
style Q5 fill:#4CAF50,stroke:#2E7D32,stroke-width:4px,color:#fff
π― Quest Objectives¶
- Explain MCP β articulate what Model Context Protocol is and why agents need it
- Configure an MCP server β connect GitHub Copilot to a GitHub MCP server (or VS Code MCP server)
- Invoke a tool through MCP β ask the agent to use an MCP-backed tool and observe the request/response
- Secure the connection β confirm MCP server runs with least-privilege access tokens
- Inspect the trace β verify the MCP tool call appears in the agent's execution trace
βοΈ The Quest Begins¶
Chapter 1 β What Is the Model Context Protocol?¶
MCP is an open standard that defines how AI agents communicate with external tools and data sources. Think of it as an adapter layer:
Agent βββΊ MCP Client βββΊ MCP Protocol (JSON-RPC) βββΊ MCP Server βββΊ External Tool/API
Without MCP, every agent-tool integration requires bespoke code. With MCP, any MCP-compatible agent can talk to any MCP-compatible server using the same protocol.
Key MCP concepts:
| Concept | Description |
|---|---|
| Server | A process exposing tools/resources to an MCP client |
| Tool | A callable function the agent can invoke (e.g., search_code, get_issue) |
| Resource | A data source the agent can read (e.g., file, DB row) |
| Prompt | A reusable prompt template the server exposes |
| Transport | How client and server communicate: stdio or SSE |
Chapter 2 β Configuring the GitHub MCP Server¶
The github/github-mcp-server provides GitHub API tools (repos, issues, PRs, code search) via MCP.
Option A: VS Code + GitHub Copilot (recommended)
Exercise 5.1: Add the GitHub MCP server to your VS Code settings.
// .vscode/settings.json (or User Settings)
{
"github.copilot.chat.mcpServers": {
"github": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${env:GITHUB_TOKEN}"
}
}
}
}
# macOS / Linux β set your PAT in the environment
export GITHUB_TOKEN=ghp_yourTokenHere
# Verify Node.js is available
node --version # must be >= 18
# Test the MCP server manually
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_TOKEN \
npx @modelcontextprotocol/server-github
Windows (PowerShell)
Expected output (truncated):
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"tools": [
{ "name": "search_repositories", ... },
{ "name": "get_file_contents", ... },
{ "name": "create_issue", ... },
...
]
}
}
Chapter 3 β Invoking MCP Tools Through Copilot¶
Once the server is configured, the Copilot agent can invoke GitHub API tools natively.
Exercise 5.2: Open VS Code, switch to a Copilot Chat session with "Agent" mode, and run:
Observe:
1. Copilot invokes the list_issues MCP tool (you'll see a "Used tool: list_issues" indicator in the chat)
2. The response includes structured data from the GitHub API
3. No additional auth is needed β the MCP server uses the GITHUB_TOKEN you configured
Chapter 4 β Writing a Custom MCP Server (Minimal Example)¶
For the GH-600 exam, you need to understand the MCP server structure. Build a minimal one:
// work/gh-600/mcp-server/src/index.js
// A minimal custom MCP server that exposes two tools:
// - get_timestamp: returns current UTC time
// - validate_plan: validates an agent plan JSON against a schema
const { Server } = require("@modelcontextprotocol/sdk/server/index.js");
const { StdioServerTransport } = require("@modelcontextprotocol/sdk/server/stdio.js");
const server = new Server(
{ name: "gh600-sandbox-mcp", version: "0.1.0" },
{ capabilities: { tools: {} } }
);
server.setRequestHandler("tools/list", async () => ({
tools: [
{
name: "get_timestamp",
description: "Returns the current UTC timestamp",
inputSchema: { type: "object", properties: {} }
},
{
name: "validate_plan",
description: "Validates an agent plan JSON string",
inputSchema: {
type: "object",
required: ["plan_json"],
properties: {
plan_json: { type: "string", description: "JSON string of the agent plan" }
}
}
}
]
}));
server.setRequestHandler("tools/call", async (req) => {
if (req.params.name === "get_timestamp") {
return { content: [{ type: "text", text: new Date().toISOString() }] };
}
if (req.params.name === "validate_plan") {
try {
const plan = JSON.parse(req.params.arguments.plan_json);
const valid = plan.task_summary && Array.isArray(plan.steps);
return { content: [{ type: "text", text: valid ? "β
Plan valid" : "β Plan missing required fields" }] };
} catch {
return { content: [{ type: "text", text: "β Invalid JSON" }] };
}
}
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main();
# Install dependencies and test
cd work/gh-600/mcp-server
npm init -y
npm install @modelcontextprotocol/sdk
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node src/index.js
Chapter 5 β Security: Scoping MCP Token Permissions¶
MCP servers inherit the permissions of their access tokens. Apply least-privilege:
# Create a fine-grained PAT for the MCP server with ONLY what it needs
# GitHub Settings > Developer Settings > Fine-grained Personal Access Tokens
# For the GitHub MCP server in a read-only observability role:
# Required scopes:
# - Contents: Read-only
# - Issues: Read-only
# - Pull requests: Read-only
# - Metadata: Read-only (required by all fine-grained PATs)
# Store the token as a GitHub Actions secret (not as a local variable in prod)
gh secret set GITHUB_MCP_TOKEN --body "ghp_yourFinegrainedToken"
Never use a PAT with admin:org or repo:write for an MCP server unless the server's purpose explicitly requires those permissions.
β Quest Validation¶
python3 scripts/validate_quest.py --quest q5
# β
VS Code MCP settings: configured
# β
Custom MCP server: src/index.js present
# β
Token scope: documented at minimum required
# π Quest Q5 complete!
π Quest Rewards¶
| Reward | Details |
|---|---|
| π MCP Initiate Badge | Earned on completion |
| π MCP Server Configuration | Skill unlocked |
| 100 XP | Added to Level 1000 total |
| Unlocks | Q6: Bind the Agent to the Realm |
π Continue Your Journey¶
- Next: Q6: Bind the Agent to the Realm
- Reference note: MCP Quick Reference
- Codex chapter: Forging the Arsenal: Tool Use & Environment
πΈοΈ Knowledge Graph¶
Structured wiki-links connect this quest to the IT-Journey knowledge graph. Open the Obsidian Graph View to explore connections.
Level hub: [[Level 1000 (8) - Cloud Computing Fundamentals]] Overworld: [[π° Overworld - Master Quest Map]] Study track: [[The Agentic Codex: GH-600 Study Hub]] Β· [[GH-600 Agentic AI Quick-Reference Notes]] Β· [[MCP Quick Reference]] Prerequisites: [[Forging the Agent's Arsenal: Tool Selection & Permissions]] Unlocks: [[Bind the Agent to the Realm: Dev Environment Integration]] Sequel quests: [[Bind the Agent to the Realm: Dev Environment Integration]] Obsidian docs: [[Obsidian Knowledge Graph and Wiki Links]]