agentleFS
MicrosoftKnown publishermicrosoft/Building-AI-Agents-From-Zero-To-Production/.github/skills/mcp-integration/SKILL.md

mcp-integration

Skill188 starsChanged 5 months agoMITView on GitHub

Help a learner give an agent tools through the Model Context Protocol (MCP) — both client-side MCP and Foundry Hosted MCP tools. Use when connecting an agent to an MCP server (e.g. the GitHub MCP server), adding a remote tool, or reasoning about MCP approval/governance.

  • Reads credentials

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Start from task-recommendation-agent.py and adapt the MCP endpoint / headers.

    line 36

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MCP integration

Guidance for adding tools to an agent via the Model Context Protocol (MCP).

Guardrails (always apply)

  • Terminology: MCP, Hosted MCP tools (Foundry-managed), Microsoft Learn MCP server.
  • Client-side MCP uses MCPStreamableHTTPTool from the current agent-framework surface. The old top-level HostedMCPTool symbol is gone — hosted tools are configured through the Foundry hosted-tool types.
  • Secrets (PATs, tokens) come from .env only. In this course the GitHub MCP server is passed a Bearer PAT via headers read from GITHUB_PERSONAL_ACCESS_TOKEN — never hardcode it.

Concepts a learner should grasp

  1. Why MCP: one open protocol lets an agent discover and call tools hosted anywhere, instead of bespoke per-tool integrations.
  2. Client MCP vs Hosted MCP: client-side, your process connects to an MCP endpoint and executes tool calls; Hosted MCP runs the connection inside Foundry with managed identity, approvals and observability.
  3. Approval workflows: hosted MCP tools can require human approval before a tool runs — important for governance in production (covered in Lesson 5).

Worked example in this repo

  • lesson-2-agent-development/task-recommendation-agent.py connects an agent to the remote GitHub MCP server as a tool (Lesson 1 Scenario 2), passing a Bearer PAT via headers. Use it as the reference implementation.

How to help

  • Start from task-recommendation-agent.py and adapt the MCP endpoint / headers.
  • For hosted/enterprise scenarios, direct the learner to lesson-5-hosted-agents-production/ for the approval-workflow and governance discussion.
  • Confirm the target MCP server URL and required auth before writing code.

Validate

  • python -m py_compile <file>.py.
  • The agent should list/call at least one MCP tool and return a grounded answer.

References

  • lesson-2-agent-development/README.md (sample catalog), lesson-5-hosted-agents-production/README.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.