sdkagent

python-sdk API reference

400 public APIs from python-sdk (modelcontextprotocol/python-sdk) — 189 classes, 143 functions, 68 methods. Signatures extracted by static analysis of the actual source.

Repository: modelcontextprotocol/python-sdk

KindCount
Classes189
Functions143
Methods68

API list

func.github.actions.conformance.client.client_mode() -> str
Pick the Client(mode=) for the harness leg.
func.github.actions.conformance.client.fetch_id_jag(audience:str, resource:str) -> str
Leg 1 - RFC 8693 token-exchange at the enterprise IdP.
func.github.actions.conformance.client.main() -> None
Main entry point for the conformance client.
func.github.actions.conformance.client.register(name:str) -> Callable[[ScenarioHandler], ScenarioHandler]
Register a scenario handler.
func.github.actions.conformance.client.run_auth_code_client(server_url:str) -> None
Authorization code flow (default for auth/* scenarios).
func.github.actions.conformance.client.run_initialize(server_url:str) -> None
Connect, initialize, list tools, close.
func.github.actions.conformance.client.run_sse_retry(server_url:str) -> None
Connect, list tools, call test_reconnection, close.
func.github.actions.conformance.client.run_tools_call(server_url:str) -> None
Connect, list tools, call add_numbers(a=5, b=3), close.
funcdocs_src.apps.tutorial002.refresh_dashboard() -> str
Refresh the dashboard data.
funcdocs_src.apps.tutorial003.refresh_report() -> str
Refresh the report data.
funcdocs_src.asgi.tutorial001.add_note(text:str) -> str
Save a note.
funcdocs_src.asgi.tutorial002.add_note(text:str) -> str
Save a note.
funcdocs_src.asgi.tutorial003.add_note(text:str) -> str
Save a note.
funcdocs_src.asgi.tutorial003.add_task(title:str) -> str
Create a task.
funcdocs_src.asgi.tutorial004.add_note(text:str) -> str
Save a note.
funcdocs_src.asgi.tutorial005.add_note(text:str) -> str
Save a note.
funcdocs_src.asgi.tutorial006.add_note(text:str) -> str
Save a note.
funcdocs_src.authorization.tutorial001.list_notes() -> list[str]
List every note in the notebook.
funcdocs_src.authorization.tutorial002.whoami() -> str
Report which OAuth client is calling.
funcdocs_src.client.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.client.tutorial002.search_books(query:str, limit:int=10) -> str
Search the catalog by title or author.
funcdocs_src.client.tutorial003.lookup_book(title:str) -> Book
Look up a book by its exact title.
funcdocs_src.client.tutorial004.books_in_genre(genre:str) -> str
Every title we stock in one genre.
funcdocs_src.client.tutorial004.genres() -> list[str]
The genres the catalog is organised by.
funcdocs_src.client.tutorial005.recommend(genre:str) -> str
Ask for a recommendation in a genre.
funcdocs_src.client.tutorial006.recommend(genre:str) -> str
Ask for a recommendation in a genre.
funcdocs_src.client.tutorial007.reserve_book(title:str) -> str
Put a book on hold.
funcdocs_src.client.tutorial007.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.client_callbacks.tutorial001.issue_card(ctx:Context) -> str
Issue a new library card.
funcdocs_src.client_callbacks.tutorial003.client_features(ctx:Context) -> list[str]
Which optional features the connected client declared.
funcdocs_src.client_callbacks.tutorial003.issue_card(ctx:Context) -> str
Issue a new library card.
funcdocs_src.client_transports.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.completions.tutorial001.github_repo(owner:str, repo:str) -> str
A GitHub repository.
funcdocs_src.completions.tutorial001.review_code(language:str, code:str) -> str
Review a snippet of code.
funcdocs_src.completions.tutorial002.github_repo(owner:str, repo:str) -> str
A GitHub repository.
funcdocs_src.completions.tutorial002.review_code(language:str, code:str) -> str
Review a snippet of code.
funcdocs_src.completions.tutorial003.github_repo(owner:str, repo:str) -> str
A GitHub repository.
funcdocs_src.completions.tutorial003.review_code(language:str, code:str) -> str
Review a snippet of code.
funcdocs_src.context.tutorial001.search_books(query:str, ctx:Context) -> str
Search the catalog by title or author.
funcdocs_src.context.tutorial002.describe_catalog(ctx:Context) -> str
Describe how the catalog is organised.
funcdocs_src.context.tutorial002.genres() -> str
The genres the catalog is organised into.
funcdocs_src.context.tutorial003.enable_recommendations(ctx:Context) -> str
Switch on the recommendation tool.
funcdocs_src.context.tutorial003.recommend_book(genre:str) -> str
Recommend a book in the given genre.
funcdocs_src.dependencies.tutorial001.reserve_book(title:str, stock:Annotated[Stock, Resolve(check_stock)]) -> str
Reserve a copy of a book.
funcdocs_src.dependencies.tutorial002.order_book(title:str, stock:Annotated[Stock, Resolve(check_stock)], delivery:Annotated[str, Resolve(estimate_delivery)]) -> str
Order a book from the shop.
funcdocs_src.dependencies.tutorial003.order_book(title:str, stock:Annotated[Stock, Resolve(check_stock)], backorder:Annotated[Backorder, Resolve(confirm_backorder)]) -> str
Order a book from the shop.
funcdocs_src.dependencies.tutorial004.recommend_book(genre:str, suggestion:Annotated[CreateMessageResult, Resolve(suggest_title)]) -> str
Recommend a book in the given genre.
funcdocs_src.deploy.tutorial001.add_note(text:str) -> str
Save a note.
funcdocs_src.deploy.tutorial002.refund(amount:int, ctx:Context) -> str | InputRequiredResult
Refund an amount, once a human has confirmed it.
funcdocs_src.deploy.tutorial003.make_server(key:str) -> MCPServer
Every worker process: the same key, and the same name.
funcdocs_src.deploy.tutorial003.refund(amount:int, ctx:Context) -> str | InputRequiredResult
Refund an amount, once a human has confirmed it.
funcdocs_src.deploy.tutorial004.edit_note(name:str, text:str, ctx:Context) -> str
Replace a note's text.
funcdocs_src.deploy.tutorial004.note(name:str) -> str
One note, by name.
funcdocs_src.elicitation.tutorial001.book_table(date:str, party_size:int, ctx:Context) -> str
Book a table at the bistro.
funcdocs_src.elicitation.tutorial002.confirm_deposit(booking_id:str, ctx:Context) -> str
Record a payment reported by the payment provider.
funcdocs_src.elicitation.tutorial002.pay_deposit(booking_id:str, ctx:Context) -> str
Take the deposit that confirms a booking.
funcdocs_src.extensions.tutorial003.stamp(text:str) -> str
Stamp a message with the office seal.
classdocs_src.extensions.tutorial004.Search
An extension that serves its own request method.
classdocs_src.extensions.tutorial005.AuditLog
Observe every tools/call without touching its result.
funcdocs_src.extensions.tutorial005.add(a:int, b:int) -> int
Add two numbers.
funcdocs_src.extensions.tutorial006.buy(item:str) -> types.CallToolResult
Buy an item.
funcdocs_src.extensions.tutorial006.redeem(token:str) -> str
Exchange a receipt token for the goods.
funcdocs_src.first_steps.tutorial001.add(a:int, b:int) -> int
Add two numbers.
funcdocs_src.first_steps.tutorial001.greeting(name:str) -> str
Greet someone by name.
funcdocs_src.first_steps.tutorial001.summarize(text:str) -> str
Summarize a piece of text in one sentence.
funcdocs_src.handling_errors.tutorial001.get_author(title:str) -> str
Look up the author of a book in the catalog.
funcdocs_src.handling_errors.tutorial002.get_author(title:str) -> str
Look up the author of a book in the catalog.
funcdocs_src.handling_errors.tutorial003.book(title:str) -> str
The catalog entry for one book.
funcdocs_src.index.tutorial001.add(a:int, b:int) -> int
Add two numbers.
funcdocs_src.index.tutorial001.greeting(name:str) -> str
Greet someone by name.
funcdocs_src.legacy_clients.tutorial003.restock(title:str, copies:int, ctx:Context) -> str
Put copies of a book back on the shelf.
funcdocs_src.legacy_clients.tutorial003.stock(title:str) -> str
How many copies of one book are on the shelf.
funcdocs_src.lifespan.tutorial001.count_books(genre:str, ctx:Context[AppContext]) -> str
Count the books in a genre.
funcdocs_src.lifespan.tutorial002.database_status(ctx:Context[AppContext]) -> str
Report whether the database connection is up.
funcdocs_src.logging.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.media.tutorial001.logo() -> Image
The brand logo as a PNG.
funcdocs_src.media.tutorial002.chime() -> Audio
The notification chime as a WAV.
funcdocs_src.media.tutorial002.logo() -> Image
The brand logo as a PNG.
funcdocs_src.media.tutorial003.logo_from_bytes() -> Image
The brand logo as a PNG.
funcdocs_src.media.tutorial004.guidelines() -> str
How to use the brand assets.
funcdocs_src.media.tutorial004.palette() -> list[str]
The brand colour palette as hex codes.
funcdocs_src.mrtr.tutorial004.briefing(ctx:Context) -> list[UserMessage] | InputRequiredResult
Draft a briefing tuned to its audience.
funcdocs_src.opentelemetry.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.progress.tutorial001.import_catalog(urls:list[str], ctx:Context) -> str
Import book records from a list of catalog URLs.
funcdocs_src.progress.tutorial002.import_feed(feed_url:str, ctx:Context) -> str
Import every record a catalog feed yields.
funcdocs_src.prompts.tutorial001.review_code(code:str) -> str
Review a piece of code.
funcdocs_src.prompts.tutorial002.debug_error(error:str) -> list[Message]
Start a debugging conversation.
funcdocs_src.prompts.tutorial002.review_code(code:str) -> str
Review a piece of code.
funcdocs_src.prompts.tutorial003.review_code(code:Annotated[str, Field(description='The code to review.')], language:Annotated[str, Field(description='The language the code is written in.')]='python') -> str
Review a piece of code.
funcdocs_src.protocol_versions.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.protocol_versions.tutorial002.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.protocol_versions.tutorial003.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.protocol_versions.tutorial004.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.real_host.tutorial001.get_author(title:str) -> str
Look up the author of a book in the catalog.
funcdocs_src.real_host.tutorial001.search_books(query:str) -> list[str]
Search the catalog by title or author.
funcdocs_src.real_host.tutorial001.titles() -> str
Every title in the catalog, one per line.
funcdocs_src.resources.tutorial001.get_config() -> str
The active shop configuration.
funcdocs_src.resources.tutorial002.get_config() -> str
The active shop configuration.
funcdocs_src.resources.tutorial002.get_user_profile(user_id:str) -> str
A customer's profile.
funcdocs_src.resources.tutorial003.catalog_stats() -> dict[str, int]
Live counts for the catalog.
funcdocs_src.resources.tutorial003.readme() -> str
How to use this server.
funcdocs_src.run.tutorial001.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.run.tutorial002.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.run.tutorial003.search_books(query:str) -> str
Search the catalog by title or author.
funcdocs_src.sampling_and_roots.tutorial001.blurb(title:str, draft:Annotated[CreateMessageResult, Resolve(draft_blurb)]) -> str
Draft a blurb for a book.
funcdocs_src.session_groups.tutorial001.hours() -> str
When the library is open.
funcdocs_src.session_groups.tutorial001.search(query:str) -> str
Search the library catalog.
funcdocs_src.session_groups.tutorial002.search(query:str) -> str
Search the web.
funcdocs_src.structured_output.tutorial001.get_temperature(city:str) -> int
Current temperature in a city, in whole degrees Celsius.
funcdocs_src.structured_output.tutorial002.get_weather(city:str) -> WeatherData
Current weather for a city.
funcdocs_src.structured_output.tutorial003.get_weather(city:str) -> WeatherData
Current weather for a city.
funcdocs_src.structured_output.tutorial004.get_weather(city:str) -> WeatherData
Current weather for a city.
funcdocs_src.structured_output.tutorial005.get_forecast(city:str, days:int) -> list[WeatherData]
Daily forecast for a city.
funcdocs_src.structured_output.tutorial007.get_weather(city:str) -> WeatherData
Current weather for a city.
funcdocs_src.structured_output.tutorial008.weather_report(city:str) -> str
A human-readable weather report for a city.
funcdocs_src.structured_output.tutorial009.get_station(name:str) -> Station
Look up a weather station by name.
funcdocs_src.troubleshooting.tutorial001.forecast(city:str) -> str
Today's forecast for one city.
funcdocs_src.troubleshooting.tutorial001.report(city:str) -> str
The full report for one city.
funcdocs_src.troubleshooting.tutorial002.forecast_hourly(city:str, hours:int) -> str
The next few hours for one city.
funcdocs_src.troubleshooting.tutorial002.forecast_today(city:str) -> str
Today's forecast for one city.
funcdocs_src.troubleshooting.tutorial003.forecast(city:str) -> str
Today's forecast for one city.
funcdocs_src.troubleshooting.tutorial004.forecast(city:str) -> str
Today's forecast for one city.
funcdocs_src.troubleshooting.tutorial005.forecast(city:str) -> str
Today's forecast for one city.
funcdocs_src.troubleshooting.tutorial006.book_table(date:str, ctx:Context) -> str
Book a table at the bistro.
funcdocs_src.troubleshooting.tutorial007.ask_to_confirm(date:str) -> Elicit[Confirmation]
Resolver: ask the user to confirm the booking.
funcdocs_src.troubleshooting.tutorial007.book_table(date:str, answer:Annotated[Confirmation, Resolve(ask_to_confirm)]) -> str
Book a table at the bistro.
funcdocs_src.troubleshooting.tutorial008.book_table(date:str, ctx:Context) -> str
Book a table at the bistro.
funcdocs_src.uri_templates.tutorial001.browse_shelf(path:list[str]) -> str
A shelf in the category tree, addressed by segments.
funcdocs_src.uri_templates.tutorial001.get_book(isbn:str) -> dict[str, str]
A single book by ISBN.
funcdocs_src.uri_templates.tutorial001.get_order(order_id:int) -> dict[str, object]
An order by its numeric id.
funcdocs_src.uri_templates.tutorial001.list_reviews(isbn:str, limit:int=10, sort:str='newest') -> str
Reviews of a book, optionally limited and sorted.
funcdocs_src.uri_templates.tutorial001.read_manual(path:str) -> str
A staff manual page.
funcdocs_src.uri_templates.tutorial002.read_manual(path:str) -> str
A staff manual page, served from a directory on disk.
funcdocs_src.uri_templates.tutorial003.preview_import(source:str) -> str
Preview a catalog import.
funcdocs_src.uri_templates.tutorial003.preview_import_relaxed(source:str) -> str
The server-wide flag exempts every resource on `relaxed`.
classsrc.mcp-types.mcp_types._types.AudioContent
Audio provided to or from an LLM.
classsrc.mcp-types.mcp_types._types.BlobResourceContents
Binary contents of a resource.
classsrc.mcp-types.mcp_types._types.CallToolResult
The server's response to a tool call.
classsrc.mcp-types.mcp_types._types.CancelTaskRequest
A request to cancel a task (2025-11-25 only).
classsrc.mcp-types.mcp_types._types.ClientCapabilities
Capabilities a client may support.
classsrc.mcp-types.mcp_types._types.Completion
Completion information.
classsrc.mcp-types.mcp_types._types.CompletionContext
Additional, optional context for completions.
classsrc.mcp-types.mcp_types._types.CompletionsCapability
Capability for completions operations.
classsrc.mcp-types.mcp_types._types.ElicitRequestFormParams
Parameters for form mode elicitation requests.
classsrc.mcp-types.mcp_types._types.ElicitRequestURLParams
Parameters for URL mode elicitation requests.
classsrc.mcp-types.mcp_types._types.ElicitResult
The client's response to an elicitation request.
classsrc.mcp-types.mcp_types._types.ElicitationCapability
Capability for elicitation operations.
classsrc.mcp-types.mcp_types._types.EmptyResult
A result that indicates success but carries no data.
classsrc.mcp-types.mcp_types._types.FormElicitationCapability
Capability for form mode elicitation.
classsrc.mcp-types.mcp_types._types.GetTaskPayloadRequestParams
Parameters for a tasks/result request.
classsrc.mcp-types.mcp_types._types.ImageContent
An image provided to or from an LLM.
classsrc.mcp-types.mcp_types._types.InitializeRequestParams
Parameters for the `initialize` request.
classsrc.mcp-types.mcp_types._types.LoggingCapability
Capability for logging operations.
classsrc.mcp-types.mcp_types._types.MCPModel
Base class for all MCP protocol types.
classsrc.mcp-types.mcp_types._types.ModelHint
Hints to use for model selection.
classsrc.mcp-types.mcp_types._types.Notification
Base class for JSON-RPC notifications.
classsrc.mcp-types.mcp_types._types.ProgressNotificationParams
Parameters for progress notifications.
classsrc.mcp-types.mcp_types._types.Prompt
A prompt or prompt template that the server offers.
classsrc.mcp-types.mcp_types._types.PromptArgument
Describes an argument that a prompt can accept.
classsrc.mcp-types.mcp_types._types.PromptMessage
Describes a message returned as part of a prompt.
classsrc.mcp-types.mcp_types._types.PromptReference
Identifies a prompt.
classsrc.mcp-types.mcp_types._types.PromptsCapability
Capability for prompts operations.
classsrc.mcp-types.mcp_types._types.Request
Base class for JSON-RPC requests.
classsrc.mcp-types.mcp_types._types.ResourceContents
The contents of a specific resource or sub-resource.
classsrc.mcp-types.mcp_types._types.ResourcesCapability
Capability for resources operations.
classsrc.mcp-types.mcp_types._types.Result
Base class for JSON-RPC results.
classsrc.mcp-types.mcp_types._types.RootsCapability
Capability for root operations.
classsrc.mcp-types.mcp_types._types.SamplingCapability
Sampling capability structure.
classsrc.mcp-types.mcp_types._types.ServerCapabilities
Capabilities that a server may support.
classsrc.mcp-types.mcp_types._types.SetLevelRequestParams
Parameters for setting the logging level.
classsrc.mcp-types.mcp_types._types.SubscribeRequestParams
Parameters for subscribing to a resource.
classsrc.mcp-types.mcp_types._types.Task
Data associated with a task (2025-11-25 only).
classsrc.mcp-types.mcp_types._types.TextContent
Text provided to or from an LLM.
classsrc.mcp-types.mcp_types._types.TextResourceContents
Text contents of a resource.
classsrc.mcp-types.mcp_types._types.Tool
Definition for a tool the client can call.
classsrc.mcp-types.mcp_types._types.ToolAnnotations
Additional properties describing a Tool to clients.
classsrc.mcp-types.mcp_types._types.ToolsCapability
Capability for tools operations.
classsrc.mcp-types.mcp_types._types.UnsubscribeRequestParams
Parameters for a resources/unsubscribe request.
classsrc.mcp-types.mcp_types._v2025_11_25.Annotations
Optional annotations for the client.
classsrc.mcp-types.mcp_types._v2025_11_25.Argument
The argument's information
classsrc.mcp-types.mcp_types._v2025_11_25.AudioContent
Audio provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2025_11_25.CallToolRequestParams
Parameters for a `tools/call` request.
classsrc.mcp-types.mcp_types._v2025_11_25.CallToolResult
The server's response to a tool call.
classsrc.mcp-types.mcp_types._v2025_11_25.CancelTaskRequest
A request to cancel a task.
classsrc.mcp-types.mcp_types._v2025_11_25.CancelTaskResult
The response to a tasks/cancel request.
classsrc.mcp-types.mcp_types._v2025_11_25.ClientCapabilities
Capabilities a client may support.
classsrc.mcp-types.mcp_types._v2025_11_25.CompleteRequestParams
Parameters for a `completion/complete` request.
classsrc.mcp-types.mcp_types._v2025_11_25.Context
Additional, optional context for completions
classsrc.mcp-types.mcp_types._v2025_11_25.CreateTaskResult
A response to a task-augmented request.
classsrc.mcp-types.mcp_types._v2025_11_25.Data
Additional information about the error.
classsrc.mcp-types.mcp_types._v2025_11_25.ElicitResult
The client's response to an elicitation request.
classsrc.mcp-types.mcp_types._v2025_11_25.Elicitation1
Task support for elicitation-related requests.
classsrc.mcp-types.mcp_types._v2025_11_25.GetPromptRequestParams
Parameters for a `prompts/get` request.
classsrc.mcp-types.mcp_types._v2025_11_25.GetTaskPayloadResult
The response to a tasks/result request.
classsrc.mcp-types.mcp_types._v2025_11_25.GetTaskRequest
A request to retrieve the state of a task.
classsrc.mcp-types.mcp_types._v2025_11_25.GetTaskResult
The response to a tasks/get request.
classsrc.mcp-types.mcp_types._v2025_11_25.Icons
Base interface to add `icons` property.
classsrc.mcp-types.mcp_types._v2025_11_25.ImageContent
An image provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2025_11_25.Implementation
Describes the MCP implementation.
classsrc.mcp-types.mcp_types._v2025_11_25.InitializeRequestParams
Parameters for an `initialize` request.
classsrc.mcp-types.mcp_types._v2025_11_25.Items1
Schema for the array items.
classsrc.mcp-types.mcp_types._v2025_11_25.JSONRPCNotification
A notification which does not expect a response.
classsrc.mcp-types.mcp_types._v2025_11_25.JSONRPCRequest
A request that expects a response.
classsrc.mcp-types.mcp_types._v2025_11_25.JSONRPCResultResponse
A successful (non-error) response to a request.
classsrc.mcp-types.mcp_types._v2025_11_25.LegacyTitledEnumSchema
Use TitledSingleSelectEnumSchema instead.
classsrc.mcp-types.mcp_types._v2025_11_25.ListTasksRequest
A request to retrieve a list of tasks.
classsrc.mcp-types.mcp_types._v2025_11_25.ListTasksResult
The response to a tasks/list request.
classsrc.mcp-types.mcp_types._v2025_11_25.ModelHint
Hints to use for model selection.
classsrc.mcp-types.mcp_types._v2025_11_25.PaginatedRequestParams
Common parameters for paginated requests.
classsrc.mcp-types.mcp_types._v2025_11_25.Prompt
A prompt or prompt template that the server offers.
classsrc.mcp-types.mcp_types._v2025_11_25.PromptArgument
Describes an argument that a prompt can accept.
classsrc.mcp-types.mcp_types._v2025_11_25.PromptMessage
Describes a message returned as part of a prompt.
classsrc.mcp-types.mcp_types._v2025_11_25.PromptReference
Identifies a prompt.
classsrc.mcp-types.mcp_types._v2025_11_25.Prompts
Present if the server offers any prompt templates.
classsrc.mcp-types.mcp_types._v2025_11_25.ReadResourceRequestParams
Parameters for a `resources/read` request.
classsrc.mcp-types.mcp_types._v2025_11_25.RelatedTaskMetadata
Metadata for associating messages with a task.
classsrc.mcp-types.mcp_types._v2025_11_25.RequestParams
Common params for any request.
classsrc.mcp-types.mcp_types._v2025_11_25.RequestedSchema
A restricted subset of JSON Schema.
classsrc.mcp-types.mcp_types._v2025_11_25.ResourceRequestParams
Common parameters when working with resources.
classsrc.mcp-types.mcp_types._v2025_11_25.Resources
Present if the server offers any resources to read.
classsrc.mcp-types.mcp_types._v2025_11_25.Roots
Present if the client supports listing roots.
classsrc.mcp-types.mcp_types._v2025_11_25.Sampling1
Task support for sampling-related requests.
classsrc.mcp-types.mcp_types._v2025_11_25.ServerCapabilities
Capabilities that a server may support.
classsrc.mcp-types.mcp_types._v2025_11_25.SetLevelRequestParams
Parameters for a `logging/setLevel` request.
classsrc.mcp-types.mcp_types._v2025_11_25.Task
Data associated with a task.
classsrc.mcp-types.mcp_types._v2025_11_25.TaskAugmentedRequestParams
Common params for any task-augmented request.
classsrc.mcp-types.mcp_types._v2025_11_25.TextContent
Text provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2025_11_25.Tool
Definition for a tool the client can call.
classsrc.mcp-types.mcp_types._v2025_11_25.ToolExecution
Execution-related properties for a tool.
classsrc.mcp-types.mcp_types._v2025_11_25.ToolUseContent
A request from the assistant to call a tool.
classsrc.mcp-types.mcp_types._v2025_11_25.Tools
Task support for tool-related requests.
classsrc.mcp-types.mcp_types._v2025_11_25.Tools1
Present if the server offers any tools to call.
classsrc.mcp-types.mcp_types._v2026_07_28.Annotations
Optional annotations for the client.
classsrc.mcp-types.mcp_types._v2026_07_28.Argument
The argument's information
classsrc.mcp-types.mcp_types._v2026_07_28.AudioContent
Audio provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2026_07_28.CallToolRequestParams
Parameters for a `tools/call` request.
classsrc.mcp-types.mcp_types._v2026_07_28.ClientCapabilities
Capabilities a client may support.
classsrc.mcp-types.mcp_types._v2026_07_28.CompleteRequestParams
Parameters for a `completion/complete` request.
classsrc.mcp-types.mcp_types._v2026_07_28.Context
Additional, optional context for completions
classsrc.mcp-types.mcp_types._v2026_07_28.Data
Additional information about the error.
classsrc.mcp-types.mcp_types._v2026_07_28.Data1
Additional information about the error.
classsrc.mcp-types.mcp_types._v2026_07_28.GetPromptRequestParams
Parameters for a `prompts/get` request.
classsrc.mcp-types.mcp_types._v2026_07_28.Icons
Base interface to add `icons` property.
classsrc.mcp-types.mcp_types._v2026_07_28.ImageContent
An image provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2026_07_28.Implementation
Describes the MCP implementation.
classsrc.mcp-types.mcp_types._v2026_07_28.Items1
Schema for the array items.
classsrc.mcp-types.mcp_types._v2026_07_28.JSONRPCNotification
A notification which does not expect a response.
classsrc.mcp-types.mcp_types._v2026_07_28.JSONRPCRequest
A request that expects a response.
classsrc.mcp-types.mcp_types._v2026_07_28.JSONRPCResultResponse
A successful (non-error) response to a request.
classsrc.mcp-types.mcp_types._v2026_07_28.ModelHint
Hints to use for model selection.
classsrc.mcp-types.mcp_types._v2026_07_28.NotificationParams
Common params for any notification.
classsrc.mcp-types.mcp_types._v2026_07_28.PaginatedRequestParams
Common params for paginated requests.
classsrc.mcp-types.mcp_types._v2026_07_28.Prompt
A prompt or prompt template that the server offers.
classsrc.mcp-types.mcp_types._v2026_07_28.PromptArgument
Describes an argument that a prompt can accept.
classsrc.mcp-types.mcp_types._v2026_07_28.PromptMessage
Describes a message returned as part of a prompt.
classsrc.mcp-types.mcp_types._v2026_07_28.PromptReference
Identifies a prompt.
classsrc.mcp-types.mcp_types._v2026_07_28.Prompts
Present if the server offers any prompt templates.
classsrc.mcp-types.mcp_types._v2026_07_28.ReadResourceRequestParams
Parameters for a `resources/read` request.
classsrc.mcp-types.mcp_types._v2026_07_28.RequestParams
Common params for any request.
classsrc.mcp-types.mcp_types._v2026_07_28.RequestedSchema
A restricted subset of JSON Schema.
classsrc.mcp-types.mcp_types._v2026_07_28.ResourceRequestParams
Common params for resource-related requests.
classsrc.mcp-types.mcp_types._v2026_07_28.Resources
Present if the server offers any resources to read.
classsrc.mcp-types.mcp_types._v2026_07_28.Result
Common result fields.
classsrc.mcp-types.mcp_types._v2026_07_28.ServerCapabilities
Capabilities that a server may support.
classsrc.mcp-types.mcp_types._v2026_07_28.TextContent
Text provided to or from an LLM.
classsrc.mcp-types.mcp_types._v2026_07_28.Tool
Definition for a tool the client can call.
classsrc.mcp-types.mcp_types._v2026_07_28.ToolUseContent
A request from the assistant to call a tool.
classsrc.mcp-types.mcp_types._v2026_07_28.Tools
Present if the server offers any tools to call.
classsrc.mcp-types.mcp_types._wire_base.WireModel
Base for generated wire models: enables `populate_by_name`; subclasses set `extra` themselves.
classsrc.mcp-types.mcp_types.jsonrpc.ErrorData
Error information for JSON-RPC error responses.
classsrc.mcp-types.mcp_types.jsonrpc.JSONRPCRequest
A JSON-RPC request that expects a response.
classsrc.mcp-types.mcp_types.jsonrpc.JSONRPCResponse
A successful (non-error) response to a request.
funcsrc.mcp.cli.claude.get_uv_path() -> str
Get the full path to the uv executable.
funcsrc.mcp.cli.cli.run(file_spec:str=typer.Argument(..., help='Python file to run, optionally with :object suffix'), transport:Annotated[str | None, typer.Option('--transport', '-t', help='Transport protocol to use (stdio or sse)')]=None) -> None
Run an MCP server.
funcsrc.mcp.cli.cli.version() -> None
Show the MCP version.
funcsrc.mcp.client._probe.negotiate_auto(session:ClientSession) -> None
Drive the ``mode='auto'`` connect-time policy on ``session``.
classsrc.mcp.client._transport.Transport
Protocol for MCP transports.
classsrc.mcp.client.auth.exceptions.OAuthFlowError
Base exception for OAuth flow errors.
classsrc.mcp.client.auth.exceptions.OAuthRegistrationError
Raised when client registration fails.
classsrc.mcp.client.auth.exceptions.OAuthTokenError
Raised when token operations fail.
classsrc.mcp.client.auth.oauth2.OAuthClientProvider
OAuth2 authentication for httpx2.
methodsrc.mcp.client.auth.oauth2.OAuthClientProvider.async_auth_flow(request:httpx2.Request) -> AsyncGenerator[httpx2.Request, httpx2.Response]
httpx2 auth flow integration.
classsrc.mcp.client.auth.oauth2.OAuthContext
OAuth flow context.
methodsrc.mcp.client.auth.oauth2.OAuthContext.can_refresh_token() -> bool
Check if token can be refreshed.
methodsrc.mcp.client.auth.oauth2.OAuthContext.clear_tokens() -> None
Clear current tokens.
methodsrc.mcp.client.auth.oauth2.OAuthContext.get_authorization_base_url(server_url:str) -> str
Extract base URL by removing path component.
methodsrc.mcp.client.auth.oauth2.OAuthContext.get_resource_url() -> str
Get resource URL for RFC 8707.
methodsrc.mcp.client.auth.oauth2.OAuthContext.is_token_valid() -> bool
Check if current token is valid.
methodsrc.mcp.client.auth.oauth2.OAuthContext.update_token_expiry(token:OAuthToken) -> None
Update token expiry time using shared util function.
classsrc.mcp.client.auth.oauth2.PKCEParameters
PKCE (Proof Key for Code Exchange) parameters.
methodsrc.mcp.client.auth.oauth2.PKCEParameters.generate() -> 'PKCEParameters'
Generate new PKCE parameters.
classsrc.mcp.client.auth.oauth2.TokenStorage
Protocol for token storage implementations.
methodsrc.mcp.client.auth.oauth2.TokenStorage.get_client_info() -> OAuthClientInformationFull | None
Get stored client information.
methodsrc.mcp.client.auth.oauth2.TokenStorage.get_tokens() -> OAuthToken | None
Get stored tokens.
methodsrc.mcp.client.auth.oauth2.TokenStorage.set_client_info(client_info:OAuthClientInformationFull) -> None
Store client information.
methodsrc.mcp.client.auth.oauth2.TokenStorage.set_tokens(tokens:OAuthToken) -> None
Store tokens.
funcsrc.mcp.client.auth.utils.extract_field_from_www_auth(response:Response, field_name:str) -> str | None
Extract field from WWW-Authenticate header.
funcsrc.mcp.client.auth.utils.handle_registration_response(response:Response) -> OAuthClientInformationFull
Handle registration response.
funcsrc.mcp.client.auth.utils.handle_token_response_scopes(response:Response) -> OAuthToken
Parse and validate a token response.
classsrc.mcp.client.caching.CacheConfig
Configuration for a `Client`'s response cache.
classsrc.mcp.client.caching.InMemoryResponseCacheStore
Default in-process `ResponseCacheStore`.
classsrc.mcp.client.caching.ResponseCacheStore
Storage contract for the client response cache.
classsrc.mcp.client.client.Client
A high-level MCP client for connecting to MCP servers.
methodsrc.mcp.client.client.Client.instructions() -> str | None
Server-provided instructions text, if any.
methodsrc.mcp.client.client.Client.list_prompts(*cursor:str | None=None, *meta:RequestParamsMeta | None=None, *cache_mode:CacheMode='use') -> ListPromptsResult
List available prompts from the server.
methodsrc.mcp.client.client.Client.list_tools(*cursor:str | None=None, *meta:RequestParamsMeta | None=None, *cache_mode:CacheMode='use') -> ListToolsResult
List available tools from the server.
methodsrc.mcp.client.client.Client.send_ping(*meta:RequestParamsMeta | None=None) -> EmptyResult
Send a ping request to the server.
methodsrc.mcp.client.client.Client.session() -> ClientSession
Get the underlying ClientSession.
methodsrc.mcp.client.client.Client.set_logging_level(level:LoggingLevel, *meta:RequestParamsMeta | None=None) -> EmptyResult
Set the logging level on the server.
methodsrc.mcp.client.session.ClientSession.discover() -> types.DiscoverResult
Probe `server/discover` and adopt the result.
methodsrc.mcp.client.session.ClientSession.discover_result() -> types.DiscoverResult | None
The server's DiscoverResult.
methodsrc.mcp.client.session.ClientSession.initialize_result() -> types.InitializeResult | None
The server's InitializeResult.
methodsrc.mcp.client.session.ClientSession.instructions() -> str | None
Server-provided instructions text, if any.
methodsrc.mcp.client.session.ClientSession.list_prompts(*params:types.PaginatedRequestParams | None=None) -> types.ListPromptsResult
Send a prompts/list request.
methodsrc.mcp.client.session.ClientSession.list_resources(*params:types.PaginatedRequestParams | None=None) -> types.ListResourcesResult
Send a resources/list request.
methodsrc.mcp.client.session.ClientSession.list_tools(*params:types.PaginatedRequestParams | None=None) -> types.ListToolsResult
Send a tools/list request.
methodsrc.mcp.client.session.ClientSession.protocol_version() -> str | None
Negotiated protocol version.
methodsrc.mcp.client.session.ClientSession.send_notification(notification:types.ClientNotification) -> None
Send a one-way notification.
methodsrc.mcp.client.session.ClientSession.send_ping(*meta:RequestParamsMeta | None=None) -> types.EmptyResult
Send a ping request.
methodsrc.mcp.client.session.ClientSession.send_roots_list_changed() -> None
Send a roots/list_changed notification.
methodsrc.mcp.client.session.ClientSession.server_capabilities() -> types.ServerCapabilities | None
Server capabilities.
methodsrc.mcp.client.session.ClientSession.server_info() -> types.Implementation | None
Server name/version.
methodsrc.mcp.client.session.ClientSession.set_logging_level(level:types.LoggingLevel, *meta:RequestParamsMeta | None=None) -> types.EmptyResult
Send a logging/setLevel request.
classsrc.mcp.client.session_group.SseServerParameters
Parameters for initializing an sse_client.
classsrc.mcp.client.streamable_http.RequestContext
Context for a request operation.
classsrc.mcp.client.streamable_http.ResumptionError
Raised when resumption request is invalid.
classsrc.mcp.client.streamable_http.StreamableHTTPError
Base exception for StreamableHTTP transport errors.
classsrc.mcp.client.streamable_http.StreamableHTTPTransport
StreamableHTTP client transport implementation.
funcsrc.mcp.os.win32.utilities.get_windows_executable_command(command:str) -> str
Resolves the command to a Windows executable path.
classsrc.mcp.server.apps.Apps
The MCP Apps extension: bind tools to `ui://` UI resources.
methodsrc.mcp.server.apps.Apps.add_resource(resource:Resource) -> None
Register a pre-built `ui://` resource.
methodsrc.mcp.server.apps.Apps.tool(*resource_uri:str, *visibility:Sequence[Visibility] | None=None, *meta:dict[str, Any] | None=None, **tool_kwargs:Any) -> Callable[[_CallableT], _CallableT]
Decorator registering a tool bound to a `ui://` resource.
methodsrc.mcp.server.apps.Apps.tools() -> Sequence[ToolBinding]
The bound tools.
classsrc.mcp.server.auth.middleware.bearer_auth.AuthenticatedUser
User with authentication info.
classsrc.mcp.server.auth.provider.TokenVerifier
Protocol for verifying bearer tokens.
methodsrc.mcp.server.auth.provider.TokenVerifier.verify_token(token:str) -> AccessToken | None
Verify a bearer token and return access info if valid.
classsrc.mcp.server.caching.CacheHint
Freshness hint for one cacheable method's results.
funcsrc.mcp.server.caching.apply_cache_hint(result:CacheableResultT, hint:CacheHint) -> CacheableResultT
Fill `ttl_ms`/`cache_scope` on `result` from `hint`.
methodsrc.mcp.server.connection.Connection.ping(*meta:Meta | None=None, *opts:CallOptions | None=None) -> None
Send a `ping` request on the standalone stream.
classsrc.mcp.server.context.Context
Server-side per-request context.
classsrc.mcp.server.elicitation.AcceptedElicitation
Result when user accepts the elicitation.
classsrc.mcp.server.elicitation.AcceptedUrlElicitation
Result when user accepts a URL mode elicitation.
classsrc.mcp.server.elicitation.CancelledElicitation
Result when user cancels the elicitation.
classsrc.mcp.server.elicitation.DeclinedElicitation
Result when user declines the elicitation.
classsrc.mcp.server.extension.Extension
Base class for an opt-in MCP extension.
methodsrc.mcp.server.extension.Extension.intercept_tool_call(params:CallToolRequestParams, ctx:ServerRequestContext[Any, Any], call_next:CallNext) -> HandlerResult
Wrap `tools/call`.
methodsrc.mcp.server.extension.Extension.tools() -> Sequence[ToolBinding]
Tools this extension contributes (additive).
classsrc.mcp.server.extension.MethodBinding
A new request method an extension serves, e.g.
classsrc.mcp.server.extension.ResourceBinding
A pre-built resource an extension contributes.
classsrc.mcp.server.extension.ToolBinding
A tool an extension contributes, plus the `_meta` to stamp on it.
classsrc.mcp.server.lowlevel.helper_types.ReadResourceContents
Contents returned from a read_resource call.
methodsrc.mcp.server.lowlevel.server.Server.session_manager() -> StreamableHTTPSessionManager
Get the StreamableHTTP session manager.
funcsrc.mcp.server.lowlevel.server.lifespan(_:Server[Any]) -> AsyncIterator[dict[str, Any]]
Default lifespan context manager that does nothing.
classsrc.mcp.server.mcpserver.context.Context
Context object providing access to MCP capabilities.
methodsrc.mcp.server.mcpserver.context.Context.debug(data:Any, *logger_name:str | None=None) -> None
Send a debug log message.
methodsrc.mcp.server.mcpserver.context.Context.elicit(message:str, schema:type[ElicitSchemaModelT]) -> ElicitationResult[ElicitSchemaModelT]
Elicit information from the client/user.
methodsrc.mcp.server.mcpserver.context.Context.elicit_url(message:str, url:str, elicitation_id:str) -> UrlElicitationResult
Request URL mode elicitation from the client.
methodsrc.mcp.server.mcpserver.context.Context.error(data:Any, *logger_name:str | None=None) -> None
Send an error log message.
methodsrc.mcp.server.mcpserver.context.Context.info(data:Any, *logger_name:str | None=None) -> None
Send an info log message.
methodsrc.mcp.server.mcpserver.context.Context.log(level:LoggingLevel, data:Any, *logger_name:str | None=None) -> None
Send a log message to the client.
methodsrc.mcp.server.mcpserver.context.Context.mcp_server() -> MCPServer
Access to the MCPServer instance.
methodsrc.mcp.server.mcpserver.context.Context.read_resource(uri:str | AnyUrl) -> Iterable[ReadResourceContents]
Read a resource by URI.
methodsrc.mcp.server.mcpserver.context.Context.report_progress(progress:float, total:float | None=None, message:str | None=None) -> None
Report progress for the current operation.
methodsrc.mcp.server.mcpserver.context.Context.request_id() -> str
Get the unique ID for this request.
methodsrc.mcp.server.mcpserver.context.Context.warning(data:Any, *logger_name:str | None=None) -> None
Send a warning log message.
classsrc.mcp.server.mcpserver.exceptions.InvalidSignature
Invalid signature for use with MCPServer.
classsrc.mcp.server.mcpserver.exceptions.MCPServerError
Base error for MCPServer.
classsrc.mcp.server.mcpserver.exceptions.ResourceError
Error in resource operations.
classsrc.mcp.server.mcpserver.exceptions.ResourceNotFoundError
Resource does not exist.
classsrc.mcp.server.mcpserver.exceptions.ToolError
Error in tool operations.
classsrc.mcp.server.mcpserver.prompts.base.AssistantMessage
A message from the assistant.
classsrc.mcp.server.mcpserver.prompts.base.Message
Base class for all prompt messages.
methodsrc.mcp.server.mcpserver.prompts.base.Prompt.render(arguments:dict[str, Any] | None, context:Context[LifespanContextT, RequestT]) -> list[Message] | InputRequiredResult
Render the prompt with arguments.
classsrc.mcp.server.mcpserver.prompts.base.PromptArgument
An argument that can be passed to a prompt.
classsrc.mcp.server.mcpserver.prompts.base.UserMessage
A message from the user.
classsrc.mcp.server.mcpserver.prompts.manager.PromptManager
Manages MCPServer prompts.
methodsrc.mcp.server.mcpserver.prompts.manager.PromptManager.add_prompt(prompt:Prompt) -> Prompt
Add a prompt to the manager.
methodsrc.mcp.server.mcpserver.prompts.manager.PromptManager.get_prompt(name:str) -> Prompt | None
Get prompt by name.
methodsrc.mcp.server.mcpserver.prompts.manager.PromptManager.list_prompts() -> list[Prompt]
List all registered prompts.
methodsrc.mcp.server.mcpserver.prompts.manager.PromptManager.remove_prompt(name:str) -> None
Remove a prompt by name.
classsrc.mcp.server.mcpserver.resolve.Elicit
A resolver's request to ask the client.
classsrc.mcp.server.mcpserver.resources.base.Resource
Base class for all resources.
methodsrc.mcp.server.mcpserver.resources.base.Resource.read() -> str | bytes
Read the resource content.
methodsrc.mcp.server.mcpserver.resources.base.Resource.set_default_name(name:str | None, info:ValidationInfo) -> str
Set default name from URI if not provided.
classsrc.mcp.server.mcpserver.resources.resource_manager.ResourceManager
Manages MCPServer resources.
methodsrc.mcp.server.mcpserver.resources.resource_manager.ResourceManager.add_resource(resource:Resource) -> Resource
Add a resource to the manager.
methodsrc.mcp.server.mcpserver.resources.resource_manager.ResourceManager.list_resources() -> list[Resource]
List all registered resources.
methodsrc.mcp.server.mcpserver.resources.resource_manager.ResourceManager.list_templates() -> list[ResourceTemplate]
List all registered templates.
classsrc.mcp.server.mcpserver.resources.templates.ResourceTemplate
A template for dynamically creating resources.
classsrc.mcp.server.mcpserver.resources.types.BinaryResource
A resource that reads from bytes.
methodsrc.mcp.server.mcpserver.resources.types.BinaryResource.read() -> bytes
Read the binary content.
classsrc.mcp.server.mcpserver.resources.types.DirectoryResource
A resource that lists files in a directory.
methodsrc.mcp.server.mcpserver.resources.types.DirectoryResource.list_files() -> list[Path]
List files in the directory.
methodsrc.mcp.server.mcpserver.resources.types.DirectoryResource.read() -> str
Read the directory listing.
methodsrc.mcp.server.mcpserver.resources.types.DirectoryResource.validate_absolute_path(path:Path) -> Path
Ensure path is absolute.
classsrc.mcp.server.mcpserver.resources.types.FileResource
A resource that reads from a file.
methodsrc.mcp.server.mcpserver.resources.types.FileResource.read() -> str | bytes
Read the file content.
methodsrc.mcp.server.mcpserver.resources.types.FileResource.validate_absolute_path(path:Path) -> Path
Ensure path is absolute.
classsrc.mcp.server.mcpserver.resources.types.HttpResource
A resource that reads from an HTTP endpoint.
methodsrc.mcp.server.mcpserver.resources.types.HttpResource.read() -> str | bytes
Read the HTTP content.

About this data

These signatures were extracted from the public source of modelcontextprotocol/python-sdk using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries