Support for http request injection propagation to tools (#816)

This commit is contained in:
ihrpr 2025-05-28 15:59:14 +01:00 • committed by GitHub
commit 70014a2bbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ from mcp.types import ToolAnnotations
if TYPE_CHECKING:
from mcp.server.fastmcp.server import Context
from mcp.server.session import ServerSessionT
from mcp.shared.context import LifespanContextT
from mcp.shared.context import LifespanContextT, RequestT
class Tool(BaseModel):
@ -85,7 +85,7 @@ class Tool(BaseModel):
async def run(
self,
arguments: dict[str, Any],
context: Context[ServerSessionT, LifespanContextT] | None = None,
context: Context[ServerSessionT, LifespanContextT, RequestT] | None = None,
) -> Any:
"""Run the tool with arguments."""
try: