Skip to content

Commit 89619a8

Browse files
authored
Add documentation structure (#1425)
1 parent 3e798bf commit 89619a8

File tree

6 files changed

+115
-4
lines changed

6 files changed

+115
-4
lines changed

docs/authorization.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Authorization
2+
3+
!!! warning "Under Construction"
4+
5+
This page is currently being written. Check back soon for complete documentation.

docs/concepts.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Concepts
2+
3+
!!! warning "Under Construction"
4+
5+
This page is currently being written. Check back soon for complete documentation.
6+
7+
<!--
8+
- Server vs Client
9+
- Three primitives (tools, resources, prompts)
10+
- Transports (stdio, SSE, streamable HTTP)
11+
- Context and sessions
12+
- Lifecycle and state
13+
-->

docs/index.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
1-
# MCP Server
1+
# MCP Python SDK
22

3-
This is the MCP Server implementation in Python.
3+
The **Model Context Protocol (MCP)** allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction.
44

5-
It only contains the [API Reference](api.md) for the time being.
5+
This Python SDK implements the full MCP specification, making it easy to:
6+
7+
- **Build MCP servers** that expose resources, prompts, and tools
8+
- **Create MCP clients** that can connect to any MCP server
9+
- **Use standard transports** like stdio, SSE, and Streamable HTTP
10+
11+
If you want to read more about the specification, please visit the [MCP documentation](https://modelcontextprotocol.io).
12+
13+
## Quick Example
14+
15+
Here's a simple MCP server that exposes a tool, resource, and prompt:
16+
17+
```python title="server.py"
18+
from mcp.server.fastmcp import FastMCP
19+
20+
mcp = FastMCP("Test Server")
21+
22+
23+
@mcp.tool()
24+
def add(a: int, b: int) -> int:
25+
"""Add two numbers"""
26+
return a + b
27+
28+
29+
@mcp.resource("greeting://{name}")
30+
def get_greeting(name: str) -> str:
31+
"""Get a personalized greeting"""
32+
return f"Hello, {name}!"
33+
34+
35+
@mcp.prompt()
36+
def greet_user(name: str, style: str = "friendly") -> str:
37+
"""Generate a greeting prompt"""
38+
return f"Write a {style} greeting for someone named {name}."
39+
```
40+
41+
Test it with the [MCP Inspector](https://github.com/modelcontextprotocol/inspector):
42+
43+
```bash
44+
uv run mcp dev server.py
45+
```
46+
47+
## Getting Started
48+
49+
<!-- TODO(Marcelo): automatically generate the follow references with a header on each of those files. -->
50+
1. **[Install](installation.md)** the MCP SDK
51+
2. **[Learn concepts](concepts.md)** - understand the three primitives and architecture
52+
3. **[Explore authorization](authorization.md)** - add security to your servers
53+
4. **[Use low-level APIs](low-level-server.md)** - for advanced customization
54+
55+
## API Reference
56+
57+
Full API documentation is available in the [API Reference](api.md).

docs/installation.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Installation
2+
3+
The Python SDK is available on PyPI as [`mcp`](https://pypi.org/project/mcp/) so installation is as simple as:
4+
5+
=== "pip"
6+
7+
```bash
8+
pip install mcp
9+
```
10+
=== "uv"
11+
12+
```bash
13+
uv add mcp
14+
```
15+
16+
The following dependencies are automatically installed:
17+
18+
- [`httpx`](https://pypi.org/project/httpx/): HTTP client to handle HTTP Streamable and SSE transports.
19+
- [`httpx-sse`](https://pypi.org/project/httpx-sse/): HTTP client to handle SSE transport.
20+
- [`pydantic`](https://pypi.org/project/pydantic/): Types, JSON schema generation, data validation, and [more](https://docs.pydantic.dev/latest/).
21+
- [`starlette`](https://pypi.org/project/starlette/): Web framework used to build the HTTP transport endpoints.
22+
- [`python-multipart`](https://pypi.org/project/python-multipart/): Handle HTTP body parsing.
23+
- [`sse-starlette`](https://pypi.org/project/sse-starlette/): Server-Sent Events for Starlette, used to build the SSE transport endpoint.
24+
- [`pydantic-settings`](https://pypi.org/project/pydantic-settings/): Settings management used in FastMCP.
25+
- [`uvicorn`](https://pypi.org/project/uvicorn/): ASGI server used to run the HTTP transport endpoints.
26+
- [`jsonschema`](https://pypi.org/project/jsonschema/): JSON schema validation.
27+
- [`pywin32`](https://pypi.org/project/pywin32/): Windows specific dependencies for the CLI tools.
28+
29+
This package has the following optional groups:
30+
31+
- `cli`: Installs `typer` and `python-dotenv` for the MCP CLI tools.

docs/low-level-server.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Low-Level Server
2+
3+
!!! warning "Under Construction"
4+
5+
This page is currently being written. Check back soon for complete documentation.

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ site_url: https://modelcontextprotocol.github.io/python-sdk
1111
# copyright: © Model Context Protocol 2025 to present
1212

1313
nav:
14-
- Home: index.md
14+
- Introduction: index.md
15+
- Installation: installation.md
16+
- Documentation:
17+
- Concepts: concepts.md
18+
- Low-Level Server: low-level-server.md
19+
- Authorization: authorization.md
1520
- API Reference: api.md
1621

1722
theme:

0 commit comments

Comments
 (0)