-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mkdocs #367
Add mkdocs #367
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: mcp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# MCP Server | ||
|
||
This is the MCP Server implementation in Python. | ||
|
||
It only contains the [API Reference](api.md) for the time being. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
site_name: MCP Server | ||
site_description: MCP Server | ||
strict: true | ||
|
||
repo_name: modelcontextprotocol/python-sdk | ||
repo_url: https://github.com/modelcontextprotocol/python-sdk | ||
edit_uri: edit/main/docs/ | ||
|
||
# TODO(Marcelo): Add Anthropic copyright? | ||
# copyright: © Model Context Protocol 2025 to present | ||
|
||
nav: | ||
- Home: index.md | ||
- API Reference: api.md | ||
|
||
theme: | ||
name: "material" | ||
palette: | ||
- media: "(prefers-color-scheme)" | ||
scheme: default | ||
primary: pink | ||
accent: pink | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should probably choose black / white since that seems to accidentally be the MCP |
||
toggle: | ||
icon: material/lightbulb | ||
name: "Switch to light mode" | ||
- media: "(prefers-color-scheme: light)" | ||
scheme: default | ||
primary: pink | ||
accent: pink | ||
toggle: | ||
icon: material/lightbulb-outline | ||
name: "Switch to dark mode" | ||
- media: "(prefers-color-scheme: dark)" | ||
scheme: slate | ||
primary: pink | ||
accent: pink | ||
toggle: | ||
icon: material/lightbulb-auto-outline | ||
name: "Switch to system preference" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You choose... 😅 |
||
features: | ||
- search.suggest | ||
- search.highlight | ||
- content.tabs.link | ||
- content.code.annotate | ||
- content.code.copy | ||
- content.code.select | ||
- navigation.path | ||
- navigation.indexes | ||
- navigation.sections | ||
- navigation.tracking | ||
- toc.follow | ||
# logo: "img/logo-white.svg" | ||
# TODO(Marcelo): Add a favicon. | ||
# favicon: "favicon.ico" | ||
|
||
# https://www.mkdocs.org/user-guide/configuration/#validation | ||
validation: | ||
omitted_files: warn | ||
absolute_links: warn | ||
unrecognized_links: warn | ||
anchors: warn | ||
|
||
markdown_extensions: | ||
- tables | ||
- admonition | ||
- attr_list | ||
- md_in_html | ||
- pymdownx.details | ||
- pymdownx.caret | ||
- pymdownx.critic | ||
- pymdownx.mark | ||
- pymdownx.superfences | ||
- pymdownx.snippets | ||
- pymdownx.tilde | ||
- pymdownx.inlinehilite | ||
- pymdownx.highlight: | ||
pygments_lang_class: true | ||
- pymdownx.extra: | ||
pymdownx.superfences: | ||
custom_fences: | ||
- name: mermaid | ||
class: mermaid | ||
format: !!python/name:pymdownx.superfences.fence_code_format | ||
- pymdownx.emoji: | ||
emoji_index: !!python/name:material.extensions.emoji.twemoji | ||
emoji_generator: !!python/name:material.extensions.emoji.to_svg | ||
options: | ||
custom_icons: | ||
- docs/.overrides/.icons | ||
- pymdownx.tabbed: | ||
alternate_style: true | ||
- pymdownx.tasklist: | ||
custom_checkbox: true | ||
- sane_lists # this means you can start a list from any number | ||
|
||
watch: | ||
- src/mcp | ||
|
||
plugins: | ||
- search | ||
- social | ||
- glightbox | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
paths: [src/mcp] | ||
options: | ||
relative_crossrefs: true | ||
members_order: source | ||
separate_signature: true | ||
show_signature_annotations: true | ||
signature_crossrefs: true | ||
group_by_category: false | ||
# 3 because docs are in pages with an H2 just above them | ||
heading_level: 3 | ||
import: | ||
- url: https://docs.python.org/3/objects.inv | ||
- url: https://docs.pydantic.dev/latest/objects.inv | ||
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
from mcp.client.session import ClientSession | ||
from mcp.server.fastmcp.server import Context | ||
from mcp.server.session import ServerSession | ||
from mcp.shared.context import RequestContext | ||
from mcp.shared.memory import ( | ||
create_connected_server_and_client_session as create_session, | ||
|
@@ -35,7 +36,7 @@ async def list_roots_callback( | |
return callback_return | ||
|
||
@server.tool("test_list_roots") | ||
async def test_list_roots(context: Context, message: str): # type: ignore[reportUnknownMemberType] | ||
async def test_list_roots(context: Context[ServerSession], message: str): # type: ignore[reportUnknownMemberType] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated, need to revert this. |
||
roots = await context.session.list_roots() | ||
assert roots == callback_return | ||
return True | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change this when my other PR gets merged.