CertPrep
Domain 8 · Lesson 8.2 · 4 min read

Building and Integrating MCP Servers

Exam skillMCP Server Development and Integration

Building, deploying, and integrating an MCP server into Claude applications and workflows, including its resources, tools, and prompts, the choice of transport (stdio or HTTP), and authentication.

Build an MCP server with the right primitives (tools, resources, prompts), choose stdio for local servers and Streamable HTTP for remote shared ones, authenticate remote users with OAuth and audience-bound tokens, and integrate the server into Claude Code, the Agent SDK, plugins or the Messages API with secrets kept out of configuration files.

What you need to know

The Model Context Protocol standardizes how applications (clients) connect models to external capabilities (servers). Build the server once; Claude Code, the Agent SDK, Claude apps and other clients can use it.

Primitives

PrimitiveControlled byUse for
ToolsThe model (it decides to call them)Actions and lookups: create ticket, query stock
ResourcesThe application or user (attached as context)Data to read: a style guide, a schema, a file
PromptsThe user (chosen from a menu, often a slash command)Reusable templates: "Summarize incident"

MCP tools reach the model like any other tool, so names, descriptions, schemas and result shaping matter just as much (see 8.1). Large outputs should be paginated or filtered.

Transport

TransportHow it runsFits
stdioThe client launches the server as a local processOne developer's machine, local files
Streamable HTTPA remote server many clients connect toShared company systems, many users

Authentication for remote servers

  • Use OAuth-based authorization so each user's actions run with their own permissions.
  • Accept only tokens issued for this server (audience-bound); never pass a client's token through to other services.
  • Validate every tool input and authorize every action on the server; do not trust what the client says about the user.
  • Log actions for audit.

Integration

ClientHow
Claude Codeclaude mcp add; scopes: local, project (.mcp.json, committed and shared), user. Use environment variable expansion for secrets; check status with /mcp
Agent SDKmcp_servers option; allow tools as mcp__server__tool
PluginsBundle the server; reference it through ${CLAUDE_PLUGIN_ROOT}
Messages APIThe MCP connector connects to remote (HTTP) servers from a request, no client code needed

In the exam

Items describe an MCP integration need or problem and ask for the primitive, transport, authentication or configuration. Map model-invoked actions to tools, attachable data to resources and user templates to prompts; local to stdio, shared to HTTP with OAuth; and keep secrets out of committed files. Distractors share admin tokens, skip auth for internal servers, pass tokens through, or change the transport to fix tool selection.

Check your understanding

Question 1

A company style guide users attach as context. Which primitive?

Show answer

Answer: C. Resources expose data for the application or user to include.

Question 2

One ticketing server for hundreds of employees, each with their own permissions. Which design fits?

Show answer

Answer: A. A remote, shared server needs per-user authorization.

Question 3

A Messages API app needs tools from a remote MCP server without writing a client. Use?

Show answer

Answer: D. It connects requests to remote MCP servers directly.

Apply it: Ship Juniper's inventory MCP server

Exercise · about 20 minCase: Juniper Outdoor Co.

Juniper's inventory MCP server is used by the support agent (Agent SDK on Juniper servers), engineers in Claude Code, and the merchandising team. It exposes get_stock, get_product and update_stock. Today it runs over stdio on one engineer's laptop with a shared database password in .mcp.json.

  1. Choose the transport and hosting.
  2. Design authentication and authorization, including update_stock.
  3. Configure each client.
  4. Add a resource and a prompt that would help users.
    Done when: no shared password exists and only merchandisers can update stock.
Check your work
Show model answer

1. Host it centrally over Streamable HTTP inside Juniper's network, behind the company identity provider.

2. OAuth with the company identity provider; tokens issued for this server only; the server checks group membership: support agent service identity and engineers get read tools only; merchandisers can call update_stock, which validates quantities and logs who changed what. The database password lives only on the server.

3. Agent SDK: mcp_servers with the HTTP URL and a service token from the secret manager; allowed tools mcp__inventory__get_stock and mcp__inventory__get_product. Claude Code: project-scoped .mcp.json with the URL and ${INVENTORY_TOKEN} expansion, no secrets. Merchandising tools: same server, their own OAuth login.

4. Resource: the product catalog schema and stock-status definitions. Prompt: "Stock report for a category," which fills in a structured request.

Key termsMCP connectorMCP serverMCP transportModel Context Protocol (MCP)Prompt templateSlash command

Sources