Jeremiah Lowin commited on
Commit
e18286f
·
unverified ·
2 Parent(s): bd3d5e6df2fdf0

Merge pull request #492 from jlowin/codex/add-agents-md-file

Browse files
Files changed (1) hide show
  1. AGENTS.md +67 -0
AGENTS.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.