This module covers MCP SDKs aligned with MCP Specification 2025-11-25. The C# SDK is currently in preview and APIs may change.
Learning objectives
By the end of this module, you will be able to:- Implement MCP solutions using official SDKs in C#, Java, TypeScript, JavaScript, and Python
- Debug and test MCP servers systematically
- Create and use server features — Resources, Prompts, and Tools
- Handle large result sets with cursor-based pagination
- Secure and deploy MCP servers to Azure
Official SDKs
MCP provides official SDKs for multiple languages:C# SDK
NuGet package
ModelContextProtocol — previewJava SDK
Requires Project Reactor for reactive programming
TypeScript SDK
Full SDK for Node.js and browser environments
Python SDK
Async/await support with FastAPI integration
Kotlin SDK
JVM-based SDK for Kotlin projects
Go SDK
Idiomatic Go implementation
Core server features
Every MCP server can implement any combination of three primitives:Resources
Resources
Resources provide context and data for the user or AI model:
- Document repositories and knowledge bases
- Structured data sources and file systems
- Any external data that enriches model context
Prompts
Prompts
Prompts are templated messages and guided workflows:
- Pre-defined conversation templates
- Guided interaction patterns for specific tasks
- Specialized dialogue structures that ensure consistency
Tools
Tools
Tools are functions the AI model can invoke:
- Data processing utilities
- External API integrations
- Computational capabilities and search functionality
Language-specific implementations
- C#
- Java
- TypeScript
- JavaScript
- Python
The C# SDK integrates with ASP.NET Core and supports the full MCP feature set.Key features:
- NuGet package:
ModelContextProtocol - ASP.NET Core integration
- Tool registration with authentication and error handling
- Multiple implementation patterns for tools of varying complexity
Pagination and large result sets
When your server handles large datasets, you need pagination to manage memory efficiently and provide responsive experiences.Why pagination matters
Without pagination, large responses cause:- Memory exhaustion — loading millions of records at once
- Slow response times — users wait while all data loads
- Timeout errors — requests exceed time limits
- Poor AI performance — LLMs struggle with massive context windows
How cursor-based pagination works
A cursor is an opaque string that marks your position in a result set — think of it as a bookmark in a long book. These MCP methods support pagination:| Method | Returns | Cursor support |
|---|---|---|
tools/list | Tool definitions | Yes |
resources/list | Resource definitions | Yes |
prompts/list | Prompt definitions | Yes |
resources/templates/list | Resource templates | Yes |
Server-side pagination
Client-side pagination
Cursor design strategies
Index-based (simple)
Index-based (simple)
The cursor is just the numeric offset into the result set.Pros: Simple and stateless.
Cons: Results can shift if items are added or removed between pages.
ID-based (stable)
ID-based (stable)
The cursor is the ID of the last seen item.Pros: Stable even if items change.
Cons: Requires ordered IDs.
Encoded state (complex)
Encoded state (complex)
The cursor encodes multiple state fields as a base64 string.Pros: Can encode complex query state.
Cons: More complex; produces larger cursor strings.
API management with Azure
Azure API Management (APIM) is a reliable solution for securing MCP servers. Placing APIM in front of your MCP server gives you:- Rate limiting — prevent abuse and ensure fair usage
- Token management — centralized API key and OAuth handling
- Monitoring — request logging via Azure Monitor
- Load balancing — distribute traffic across server instances
- Security — authentication and authorization enforcement
Deploy a secured MCP server to Azure
Provision all Azure resources
Azure Functions quickstart templates
Theremote-mcp-functions template set lets you build and deploy custom remote MCP servers using Azure Functions:
Python
Build and deploy with Azure Functions and Python
C# .NET
Build and deploy with Azure Functions and C# .NET
Node/TypeScript
Build and deploy with Azure Functions and TypeScript
- Local development and debugging support
- Security by design with HTTPS and key-based auth
- OAuth support via built-in auth and APIM
- Network isolation with Azure Virtual Networks
- Simple one-command deployment:
azd up
Key takeaways
- MCP SDKs provide language-specific tools for building robust solutions across C#, Java, TypeScript, JavaScript, and Python
- Use cursor-based pagination for all large result sets — never load everything into memory
- Debug and test your MCP servers systematically before deploying
- Azure API Management adds enterprise-grade security, rate limiting, and monitoring to remote MCP servers
- Reusable prompt templates ensure consistent AI interactions across your application
Exercise
Design a practical MCP workflow that addresses a real-world problem in your domain:- Identify 3–4 tools useful for solving the problem
- Create a workflow diagram showing how those tools interact
- Implement a basic version of one tool using your preferred language
- Add cursor-based pagination if the tool returns a list of items
- Create a prompt template that helps the model use your tool effectively
Next: Advanced Topics
Explore multi-modal integration, scaling, security, and enterprise patterns
MCP Specification
Full protocol specification including pagination details