Jeremiah Lowin commited on
Commit
f190ac6
·
1 Parent(s): 84c02af

Update AGENTS.md

Browse files
Files changed (1) hide show
  1. AGENTS.md +59 -16
AGENTS.md CHANGED
@@ -1,24 +1,67 @@
1
  # AGENTS
2
 
3
- This repository contains the FastMCP source code and documentation.
4
- It is organized as follows:
5
 
6
- - `src/fastmcp/` the main library implementation. Key modules include:
7
- - `server/` with the `FastMCP` server and supporting classes like `Context`.
8
- - `client/` with the high-level `Client` for connecting to MCP servers.
9
- - subpackages for `resources`, `prompts`, `tools`, and other utilities.
10
- - `tests/` – pytest-based unit tests for the library.
11
- - `docs/` – documentation written for Mintlify and published on gofastmcp.com.
12
- - `examples/` – small example applications demonstrating library usage.
13
 
14
- Before committing any changes, run:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ```bash
17
- uv sync # install dependencies
18
- uv run pre-commit run --all-files
19
- uv run pytest
20
  ```
21
 
22
- `pre-commit` runs Ruff, Prettier, and Pyright. Make sure changes under
23
- `src/` or `tests/` include corresponding tests. Please keep this file
24
- updated if the repository layout or tooling changes.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # AGENTS
2
 
3
+ > **Audience**: LLM-driven engineering agents
 
4
 
5
+ This file provides guidance for autonomous coding agents working inside the **FastMCP** repository.
 
 
 
 
 
 
6
 
7
+ ---
8
+
9
+ ## Repository map
10
+
11
+ | Path | Purpose |
12
+ | ---------------- | ---------------------------------------------------------------------------------------- |
13
+ | `src/fastmcp/` | Library source code (Python ≥ 3.10) |
14
+ | ` └─server/` | Server implementation, `FastMCP`, auth, networking |
15
+ | ` └─client/` | High‑level client SDK + helpers |
16
+ | ` └─resources/` | MCP resources and resource templates |
17
+ | ` └─prompts/` | Prompt templates |
18
+ | ` └─tools/` | Tool implementations |
19
+ | `tests/` | Pytest test‑suite |
20
+ | `docs/` | Mintlify‑flavoured Markdown, published to [https://gofastmcp.com](https://gofastmcp.com) |
21
+ | `examples/` | Minimal runnable demos |
22
+
23
+ ---
24
+
25
+ ## Mandatory dev workflow
26
 
27
  ```bash
28
+ uv sync # install dependencies
29
+ uv run pre-commit run --all-files # Ruff + Prettier + Pyright
30
+ uv run pytest # run full test suite
31
  ```
32
 
33
+ *Tests must pass* and *lint/typing must be clean* before committing.
34
+
35
+ ### Core MCP objects
36
+
37
+ There are four major MCP object types:
38
+
39
+ - Tools (`src/tools/`)
40
+ - Resources (`src/resources/`)
41
+ - Resource Templates (`src/resources/`)
42
+ - Prompts (`src/prompts`)
43
+
44
+ While these have slightly different semantics and implementations, in general changes that affect interactions with any one (like adding tags, importing, etc.) will need to be adopted, applied, and tested on all others. Be sure to look at not only the object definition but also the related `Manager` (e.g. `ToolManager`, `ResourceManager`, and `PromptManager`). Also note that while resources and resource templates are different objects, they both are handled by the `ResourceManager`.
45
+
46
+ ---
47
+
48
+ ## Code conventions
49
+
50
+ * **Language:** Python ≥ 3.10
51
+ * **Style:** Enforced through pre-commit hooks
52
+ * **Type-checking:** Fully typed codebase
53
+ * **Tests:** Each feature should have corresponding tests
54
+
55
+ ---
56
+
57
+ ## Development guidelines
58
+
59
+ 1. **Set up** the environment:
60
+ ```bash
61
+ uv sync && uv run pre-commit run --all-files
62
+ ```
63
+ 2. **Run tests**: `uv run pytest` until they pass.
64
+ 3. **Iterate**: if a command fails, read the output, fix the code, retry.
65
+ 4. Make the smallest set of changes that achieve the desired outcome.
66
+ 5. Always read code before modifying it blindly.
67
+ 6. Follow established patterns and maintain consistency.