Building a production MCP server in .NET
By Barry Luijbregts.
A demo MCP server is a list of tools and a local process. A production one has to survive a client it has never seen, sign that client in without a shared password, and refuse to touch billing when the model asks for the wrong thing. Podhome's server is that second kind. It is the same server Claude uses.
The user guide is Manage your podcast with Claude. The setup page is Use Podhome with Claude and AI assistants. This page is the shape of the server behind them. The HTTP API the tools call is documented at serve.podhome.fm/api/docs.

The public surface
Podhome.Serve is an ASP.NET Core app. The MCP endpoint is https://serve.podhome.fm/api/mcp. The server is listed in the Official MCP Registry as fm.podhome/podhome, and in the Claude Connectors Directory.
The C# SDK is ModelContextProtocol.AspNetCore. Registration is small on purpose. Tools are discovered from the assembly, the transport is HTTP, and the endpoint requires authorization:
builder.Services.AddMcpServer()
.WithHttpTransport()
.WithToolsFromAssembly()
.AddAuthorizationFilters();
app.MapMcp("/api/mcp").RequireAuthorization("McpAccess");
Each tool is a method on a class marked as an MCP tool type: shows, episodes, chapters, clips, people, transcripts, analytics, account, Podhome AI, and alternate media. The full list is the table on the MCP docs. The tools call the same services as the Integration API. There is no second podcast implementation hiding behind the protocol.
Why the server runs its own OAuth 2.1
Claude, Claude Code, and any other remote MCP client show up as a public client. They do not have a client secret you can hand them in advance, and they do not share a password with Podhome. Podhome's login is Azure AD B2C, which does not speak dynamic client registration or the protected-resource metadata remote MCP clients expect. So Serve runs a small OAuth 2.1 authorization server in front of B2C.
The metadata document is /.well-known/oauth-authorization-server (RFC 8414). It advertises the authorization code grant, the refresh-token grant, S256 as the only PKCE method, and none as the token-endpoint auth method. Public clients identify themselves with a client_id. They do not present a secret.
Dynamic client registration
POST /oauth/register is RFC 7591. The client sends a name and one or more redirect URIs. The server checks those URIs, stores a short-lived registration, and returns a client_id. Registrations and in-flight login state live in memory with a TTL. Refresh tokens do not. A restart can forget a client that never finished signing in. A client that already has a refresh token keeps working, because that token is a row in the database.
PKCE, then B2C, then a consent screen
GET /oauth/authorize requires response_type=code, a registered client_id, a redirect URI that matches the registration, and a PKCE code_challenge. Anything other than S256 fails when the code is redeemed. The server stores the challenge and sends the browser to B2C. B2C is the only place the password is typed.
When B2C returns to GET /oauth/callback, Serve exchanges that code, reads the email, and redirects to a consent page. The page shows the app name, the redirect host, and the access being granted. Approve issues Podhome's own authorization code and sends the browser back to the MCP client, with the client's state unchanged. Deny sends the client access_denied.
The tokens
POST /oauth/token checks the authorization code, the redirect URI, the client id, and the PKCE verifier. The verifier is the raw string. The check is SHA-256, then base64url, compared with the challenge stored at the start. A match issues two tokens:
- An access token: a JWT, one hour, signed with RSA (RS256). The payload carries
sub,email, and theemailsclaim the tools already knew how to read from B2C. The audience is the dynamicclient_id. The public key is atGET /oauth/jwks. - A refresh token: 90 days, stored in the database, single use. Each refresh deletes the old row and writes a new one, which is the OAuth 2.1 rotation rule. The connection date stays the original one, so Account → User Settings → Connected AI apps still shows when you approved the app. Revoking the connection there removes the refresh token.
The signing key is an RSA key loaded from configuration, so tokens stay valid across restarts. A missing key means a temporary key and a server that will not honor yesterday's tokens. Production does not run that way.
What the 401 tells a client
An MCP client that does not have a token yet gets a 401. The WWW-Authenticate header includes resource_metadata, pointing at the protected-resource metadata (RFC 9728). That document names the resource (https://serve.podhome.fm/api/mcp) and this authorization server. The client can walk from a 401 to registration, to PKCE, to a token, without a setup guide.
Tool methods also carry annotations: read-only, open-world, and destructive. A list of episodes is read-only. Deleting an episode is destructive. Clients that honor the hints can ask a person before they call the second kind. The annotations are part of making the server scannable. They are not a substitute for the consent screen.
The other credential
OAuth is how Claude signs in. A script, or an MCP client that cannot do OAuth, sends the show API key from Settings → Integration in the X-API-KEY header on https://serve.podhome.fm/api/mcp. It is not a parameter on any tool, and it is not a message you paste into a chat. Both paths reach the same tools. The API key is scoped to the show it belongs to. The OAuth token is scoped to the shows that Podhome user can already open. Neither path can read billing details or payment methods. That boundary is the same one as the Integration API.
The registry, and what is not live
Publishing to the Official MCP Registry is a name, fm.podhome/podhome, and the remote URL. The Claude directory is a separate listing, at claude.ai/directory/podhome. Connecting from Claude is Settings → Connectors, then Podhome.
The same server answers the discovery pieces an OpenAI-style MCP scan looks for, including protected-resource metadata and a domain challenge endpoint used for plugins-directory verification. A ChatGPT plugin is not available. ChatGPT does not connect to this server yet. The MCP docs will say when that changes.
If you are building one
The pieces that mattered, in the order we needed them:
- Tools that call the product you already have, with honest read-only and destructive hints.
- Authorization-server metadata, protected-resource metadata, and a 401 that points at the second one.
- Dynamic client registration, because you will not pre-register every assistant.
- PKCE with S256 only, and a consent screen before you mint a code.
- A short-lived signed access token, and a refresh token you can delete.
- A login system you already trust behind that flow. For us, that is B2C.
The connector is included in Podhome's one plan, $15.99 a month or $185 a year. There is no API tier above it. Start the 30-day trial of that plan if you want an account to connect. If you want the agent side, the follow-on is Agentic podcast automation with Claude Code and the Podhome API.
Questions go to support@podhome.fm.