onemodelcontextDocs
onemodelcontext docs
Everything about OneModelContext 1.0: getting started, transports, tools and schemas, authorization on both sides, extensions, stores and what the conformance suite checked. Model Context Protocol® is a registered trademark of LF Projects, LLC. OneModelContext is an independent project and is not affiliated with or endorsed by LF Projects, LLC or the Model Context Protocol project.
Start
Getting startedInstall OneModelContext 1.0.1 for .NET 10, write a server with two tools and a resource, connect a client to it over stdio and over Streamable HTTP, host it on ASP.NET Core, and drive it from the command line. Every sample on this page was run on the 1.0.1 packages from NuGet…OverviewOneModelContext is a clean-room .NET 10 library for MCP, the Model Context Protocol, on both sides: client and server. The core package (RecursiveAI.OneModelContext) depends on the .NET base class library only, and is trim- and NativeAOT-safe.SamplesSmall programs that show how OneModelContext is used. Each one runs on both protocol eras (2026-07-28 and the older revisions) without changes to its code, and each has tests in tests/RecursiveAI.OneModelContext.SamplesTests.Coming from the official C# SDKA task map for developers who know the official C# SDK (ModelContextProtocol, ModelContextProtocol.AspNetCore) and want the same thing in OneModelContext. It lists where to look, not which is better: the two libraries make different choices (this one has a BCL-only core…
Transports
Stdio and duplex streamsMessages are UTF-8 JSON-RPC, one per line. Standard output carries only protocol messages; diagnostics belong on standard error. Both protocol eras share the stream. A legacy initialize is an admission barrier: its outcome is visible before later requests or notifications on…Streamable HTTP clientModelContext.ConnectAsync("https://host/mcp") (or ConnectAsync(new Uri(...)), or ContextTransport.Http(uri, client, options)) connects over Streamable HTTP. Every message is a POST to the endpoint; the answer is a JSON body or an event stream. The client speaks both eras and…Streamable HTTP server and the listenerStreamableHttpEndpoint serves both protocol eras on one path over the small IHttpExchange abstraction. Every limit below is a property of StreamableHttpOptions.
Tools, resources and prompts
Tool signatures and JSON SchemaThe [Tool] source generator and the reflection quick path (server.Tool("name", delegate)) write the same schema for the same signature. This note is that mapping. It follows the table that OneLLM publishes for its tools (docs/tool-schemas.md in OneLLM), so a method declared…Asking the client for inputA tool, prompt or resource handler can ask the client for input in the middle of a request: ctx.ConfirmAsync, ctx.ElicitAsync, ctx.SampleAsync, ctx.ListRootsAsync, ctx.ElicitUrlAsync. The handler code is the same on every protocol revision. What happens underneath is not.
Authorization
Resource serverAn MCP server that listens on HTTP can require OAuth 2.1 bearer tokens. OneModelContext plays the resource server role: it serves protected resource metadata, challenges requests without a valid token, and checks that every token was issued for this server. Authentication is…OAuth clientOAuthClient signs a program in to an OAuth-protected server and keeps its tokens fresh. It lives in the RecursiveAI.OneModelContext.OAuth namespace, which holds no protocol types, and follows the 2026-07-28 authorization pages (with the 2025-03-26, 2025-06-18 and 2025-11-25…Authorization serverA .NET application can be the OAuth 2.1 authorization server for its own MCP endpoint, so it can act as a connector for hosted clients without a third-party identity provider. AuthorizationServer implements the protocol; you keep the users. Signing a user in and asking for…
Extensions and packages
ExtensionsAn extension adds methods, notifications, _meta keys or capability settings to the Model Context Protocol (MCP) without a new core revision. The mechanism is public and the official extensions use it. This page covers writing one and what MCP Apps adds. Source: the MCP…Hosting and Extensions.AITwo small packages, each referencing the core package and the one Microsoft package it adapts.Entity Framework Core and OneLite storesRecursiveAI.OneModelContext.EntityFrameworkCore keeps the authorization server's state and a client's tokens in your own database, so several instances of an application can share them. It references the core package and Entity Framework Core (the base package and…
Testing and history
ConformanceOneModelContext is checked against the protocol's official conformance suite, run as a black box: it is installed from its published package and driven through its command line. Its files are never read or copied into this repository.InteropOneModelContext is checked against other implementations of the protocol, run as black boxes: installed from their published releases at pinned versions and driven through their command lines, their wire behaviour and small programs in this directory written from each SDK's…ChangelogAll notable changes are recorded here, following Keep a Changelog.