<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr" -->

---
title: Passing parameters to a hosted MCP Server in C# | daily.dev
description: Model Context Protocol (MCP) servers can use two transport mechanisms: STDIO (local process communication via stdin/stdout) and hosted servers (HTTP/SSE...
canonical: https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Passing parameters to a hosted MCP Server in C# | daily.dev
og:description: Model Context Protocol (MCP) servers can use two transport mechanisms: STDIO (local process communication via stdin/stdout) and hosted servers (HTTP/SSE...
og:url: https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr
og:image: https://api.daily.dev/og/posts/xXKsQwDqr.png
og:image:alt: Passing parameters to a hosted MCP Server in C#
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Passing parameters to a hosted MCP Server in C#

**[The Art of Simplicity](https://daily.dev/sources/bartwullems)** · 6 min read · 1 upvotes · 0 comments

## Summary

Model Context Protocol (MCP) servers can use two transport mechanisms: STDIO (local process communication via stdin/stdout) and hosted servers (HTTP/SSE endpoints). For hosted MCP servers in C#, parameters are passed through URLs, query strings, or headers rather than environment variables. The article demonstrates extracting URL route parameters in an ASP.NET Core MCP server using IHttpContextAccessor and a ProjectContext abstraction, enabling multiple server instances scoped to different Azure DevOps projects and teams. Best practices include secure credential management, proper URL encoding, parameter validation, and robust error handling.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bartwullems.blogspot.com/2026/01/passing-parameters-to-hosted-mcp-server.html>

## Similar posts on daily.dev

- [Your first MCP server with ASP.NET](https://daily.dev/posts/your-first-mcp-server-with-asp-net-0kwwmyuuj) · Tim Deschryver · 20 upvotes · 3 comments
- [Building an MCP Server in .NET Without Buying the Hype — Daily DevOps & .NET](https://daily.dev/posts/building-an-mcp-server-in-net-without-buying-the-hype-daily-devops-net-f3pfe3wik) · Daily DevOps & .NET · 1 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#c#](https://daily.dev/tags/c#), [#mcp](https://daily.dev/tags/mcp), [#aspnetcore](https://daily.dev/tags/aspnetcore), [#azure-devops](https://daily.dev/tags/azure-devops)

[View this post on daily.dev](https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Passing parameters to a hosted MCP Server in C#","url":"https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr"},"datePublished":"2026-01-23T12:34:02.312Z","dateModified":"2026-01-23T12:34:27.598Z","description":"Model Context Protocol (MCP) servers can use two transport mechanisms: STDIO (local process communication via stdin/stdout) and hosted servers (HTTP/SSE...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/09c10b6cbdac88b49ec3d5d9bb86ac8c?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/09c10b6cbdac88b49ec3d5d9bb86ac8c?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"The Art of Simplicity","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Art of Simplicity","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52b68c70636d44f0901ae7cd107c9438","url":"https://daily.dev/sources/bartwullems"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/passing-parameters-to-a-hosted-mcp-server-in-c--xxksqwdqr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,c#,mcp,aspnetcore,azure-devops","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Art of Simplicity","item":"https://daily.dev/sources/bartwullems"},{"@type":"ListItem","position":3,"name":"Passing parameters to a hosted MCP Server in C#"}]}
```

