Improve docs landing page (#1114)
This commit is contained in:
parent
8316aa0895
commit
aa2f8f444b
1 changed files with 23 additions and 5 deletions
|
|
@ -8,7 +8,7 @@ uid: httpcontext
|
|||
## HTTP Context
|
||||
|
||||
When using the Streamable HTTP transport, an MCP server might need to access the underlying [HttpContext] for a request.
|
||||
The [HttpContext] contains request metadata such as the HTTP headers, authorization context, and the actual path and query string for the request.
|
||||
The [HttpContext] object contains request metadata such as the HTTP headers, authorization context, and the actual path and query string for the request.
|
||||
|
||||
To access the [HttpContext], the MCP server should add the [IHttpContextAccessor] service to the application service collection (typically in Program.cs).
|
||||
Then any classes, for example, a class containing MCP tools, should accept an [IHttpContextAccessor] in their constructor and store this for use by its methods.
|
||||
|
|
|
|||
Loading…
Reference in a new issue