اس صفحے کا مرکزی مواد انگریزی میں ہے۔اس صفحے کا ترجمہ کریں
AI اور مقبول موضوعات
MCP: Model Context Protocol roadmap
The Model Context Protocol (MCP) is an open standard for connecting AI applications to tools, data and prompts. Build an MCP server once, and many AI clients can use it. Learn the concepts, build servers in Python, and deploy them securely.
- وقت
- ⏱ 2–3 weeks
- Level
- Intermediate
- Steps
- 5 steps
- Progress
- 0/5 done
The roadmap
Click a step to open the full guide.
Best architecture: MCP in an organisation
How AI apps reach company tools through MCP servers safely.
MCP deployment
- AI app (host)
- MCP client
- Remote MCP server (OAuth)
- Company APIs / DBs (least privilege)
- Audit logs
Why it's built this way
- One MCP server per system, owned by that system's team.
- Remote servers use OAuth and per-user permissions.
- Read-only tools by default; writes need approval.
- Audit logs every tool call. کے لیے
MCP: Model Context Protocol cheat sheet
The essentials on one screen. Bookmark it for revision.
Concepts
| Host | The AI app (chat, IDE, agent) |
|---|---|
| Client | Connector inside the host, one per server |
| سرور | Exposes tools, resources, prompts |
| Tool | Model-called action, e.g. get_order(id) |
| Resource | Read-only data with a URI |
| Prompt | User-picked template |
Python SDK (FastMCP)
| Create server | mcp = FastMCP("name") |
|---|---|
| Tool | @mcp.tool() on a typed function with a docstring |
| Resource | @mcp.resource("docs://faq") |
| Prompt | @mcp.prompt() |
| Run (local) | mcp.run() (stdio) |
| Test | MCP Inspector |
Improve performance
- Return short, structured results; huge tool outputs slow the model and cost tokens.
- Paginate list tools (e.g.
limitandcursorparameters) instead of returning everything. - Cache slow lookups inside the server.
- Keep the number of tools per server focused; too many similar tools confuse the model.
- For remote servers, keep them stateless where possible so they scale horizontally.
Security checklist
- Install only trusted servers; review what third-party servers can access.
- Always require authentication for remote servers; enforce per-user permissions.
- Validate and sanitise every tool argument.
- Treat tool outputs (web pages, emails, files) as untrusted text that may contain injected instructions.
- Require human approval for actions that send, pay, delete or change permissions.
- Log every tool call with user, arguments and result for auditing.
Most important interview questions
Click a question to see a strong answer. Each step also has its own questions.
1the Model Context Protocol کیا ہے؟
An open standard that lets AI applications connect to external tools, data and prompt templates through MCP servers, so integrations are built once and reused across apps.
2Describe the MCP architecture.
A host application contains MCP clients; each client connects to one MCP server over a transport (stdio or HTTP); servers expose tools, resources and prompts that the host makes available to the model.
3How does a model actually use an MCP tool?
The host fetches the tool list and schemas from the server, passes them to the model as callable functions, the model requests a call, the client forwards it to the server, and the result is returned to the model.
4When would you build an MCP server instead of a direct integration?
When you want the same capability available in several AI apps or agents, or want users to plug your service into their own AI tools.
5How do you design good MCP tools?
One clear job per tool, descriptive names, precise docstrings with examples, simple typed inputs, concise structured outputs, and safe defaults (read-only first).
6prompt injection in the context of MCP کیا ہے؟
Text returned by a tool, such as a web page or email, containing instructions that try to make the model misuse other tools. Mitigate with least privilege, approvals and treating outputs as data.
Related روڈ میپ
AI Agents
6 steps · 3–4 weeks · Intermediate
Build AI that plans, uses tools and gets work done.
View roadmap →AI Engineer
6 steps · 4–6 months · Intermediate
Build products on top of large language models.
View roadmap →RAG: Retrieval-Augmented Generation
6 steps · 3–4 weeks · Intermediate
Build AI that answers from your own documents.
View roadmap →