Skip to content

Commit a5efbf3

Browse files
BYKGPT-6 Sol
andauthored
Make root docs the shared Toolkit home (#1438)
## Summary Make root `docs/` the shared entry point for Sentry CLI, Sentry MCP, and contributor guidance. Link to the published CLI docs and their existing Astro source without moving the release-built site. Update root guidance and CI-selection wording; root docs remain quality-checked without selecting product jobs. Closes #1363 ## Validation - `pnpm run tsc` - `pnpm run lint` - `pnpm run test` - `pnpm run check:generated` - `pnpm run docs:check` - `pnpm run test:ci-projects` - `pnpm exec oxfmt --check` on changed files - `node scripts/pre-commit-generated.mjs` Co-authored-by: GPT-6 Sol <agent@openai.com>
1 parent da0c13a commit a5efbf3

11 files changed

Lines changed: 268 additions & 146 deletions

File tree

‎AGENTS.md‎

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# AGENTS.md
2-
Sentry MCP is a Model Context Protocol server that exposes Sentry's error tracking and performance monitoring to AI assistants through 19 tools.
2+
3+
Toolkit contains the Sentry CLI, the Sentry MCP server, and shared code. Product-specific instructions live in their packages; start with the shared [documentation index](docs/README.md).
34

45
## Principles
56

@@ -9,90 +10,104 @@ Sentry MCP is a Model Context Protocol server that exposes Sentry's error tracki
910

1011
## Constraints
1112

12-
- **Tool count**: Target ≤20, hard limit 25 (AI agents have limited tool slots).
13+
- **MCP tool count**: Target ≤20, hard limit 25 (AI agents have limited tool slots).
1314
- **Quality gate**: `pnpm run tsc && pnpm run lint && pnpm run test` must pass before committing.
1415

1516
## Repository Structure
1617

1718
```
18-
sentry-mcp/
19+
toolkit/
20+
├── apps/
21+
│ └── cli-docs/ # CLI documentation site and generated command pages
1922
├── packages/
23+
│ ├── cli/ # Sentry CLI (see packages/cli/AGENTS.md)
24+
│ ├── toolkit-core/ # Shared CLI/MCP primitives
2025
│ ├── mcp-core/ # Core MCP implementation (private)
21-
│ │ └── src/
22-
│ │ ├── tools/ # 19 tool modules
23-
│ │ ├── server.ts # buildServer()
24-
│ │ ├── api-client/ # Sentry API
25-
│ │ └── internal/ # Shared utils
2626
│ ├── mcp-server/ # stdio transport (@sentry/mcp-server on npm)
2727
│ ├── mcp-cloudflare/ # Web app + OAuth
2828
│ ├── mcp-server-evals/ # AI evaluation tests
2929
│ ├── mcp-server-mocks/ # MSW mocks
3030
│ └── mcp-test-client/ # CLI test client
31-
└── docs/ # All documentation
31+
└── docs/ # Toolkit contributor docs for CLI and MCP
3232
```
3333

3434
## Documentation Map
3535

36-
- docs/README.md — Full documentation index
36+
- docs/README.md — Toolkit documentation index
37+
- docs/cli/README.md — CLI guides and the published CLI site
38+
- docs/mcp/README.md — MCP guides across its packages
39+
- packages/cli/AGENTS.md — CLI-specific rules
40+
41+
**Read before MCP tool changes:**
3742

38-
**Read before tool changes:**
3943
- docs/contributing/adding-tools.md — Tool implementation guide
4044
- docs/contributing/tool-responses.md — Tool output policy and QA review checklist
4145
- docs/testing/overview.md — Testing requirements and snapshot policy
4246
- docs/contributing/common-patterns.md — Error handling, Zod schemas, shared formatting patterns
4347
- docs/contributing/error-handling.md — Error types and propagation
4448

45-
**Contributing:**
46-
- docs/contributing/api-patterns.md — Sentry API client usage
49+
**Shared contributing:**
50+
4751
- docs/contributing/coding-guidelines.md — TypeScript and code style guidance
4852
- docs/contributing/documentation-style-guide.md — Documentation style guide
4953
- docs/contributing/pr-management.md — Commit and PR guidelines
5054
- docs/contributing/quality-checks.md — Pre-commit checklist
55+
56+
**MCP contributing:**
57+
58+
- docs/contributing/api-patterns.md — Sentry API client usage
5159
- docs/contributing/search-events-api-patterns.md — Search Events API patterns
5260

53-
**Testing:**
61+
**MCP testing:**
62+
5463
- docs/testing/overview.md — Unit, snapshot, eval, and agent CLI testing
5564
- docs/testing/stdio.md — Stdio transport testing
5665
- docs/testing/remote.md — Remote server and OAuth testing
5766

58-
**Architecture and Operations:**
59-
- docs/architecture/overview.md — System design
67+
**MCP architecture and operations:**
68+
69+
- docs/architecture/overview.md — MCP system design
6070
- docs/operations/security.md — Authentication and security patterns
6171
- docs/operations/stdio-auth.md — Device code flow, token caching, client ID architecture
6272
- docs/operations/oauth-signout-playbook.md — Remote OAuth diagnostic runbook
6373
- docs/operations/embedded-agents.md — LLM provider configuration for AI-powered tools
64-
- docs/operations/github-actions.md — GitHub Actions guidance
74+
- docs/operations/github-actions.md — MCP deployment workflows
6575
- docs/operations/logging.md — Logging guidance
6676
- docs/operations/monitoring.md — Monitoring guidance
6777
- docs/operations/token-cost-tracking.md — Tool definition token cost tracking
6878

69-
**Cloudflare:**
79+
**MCP Cloudflare:**
80+
7081
- docs/cloudflare/overview.md — Cloudflare package overview
7182
- docs/cloudflare/architecture.md — Cloudflare architecture
7283
- docs/cloudflare/oauth-architecture.md — Cloudflare OAuth architecture
7384

74-
**Integrations:**
85+
**MCP integrations:**
86+
7587
- docs/integrations/claude-code-plugin.md — Plugin structure and agent prompts
7688
- docs/integrations/ide-instructions-refactor.md — IDE instruction refactor notes
7789

78-
**Specs:**
90+
**MCP specs:**
91+
7992
- docs/specs/README.md — Specs index
8093
- docs/specs/embedded-agent-openai-routing.md — Embedded agent OpenAI routing spec
8194
- docs/specs/search-events.md — Search Events spec
8295
- docs/specs/subpath-constraints.md — Subpath constraints spec
8396

84-
**Releases:**
97+
**MCP releases:**
98+
8599
- docs/releases/stdio.md — npm package release
86100
- docs/releases/cloudflare.md — Cloudflare deployment
87101

88102
## Commands
89103

90104
```bash
91105
# Development
92-
pnpm run dev # Start dev server
93-
pnpm run build # Build all packages
106+
pnpm run dev # Start MCP dev server
107+
pnpm run build # Build non-CLI workspace packages
108+
pnpm --filter sentry run cli help # Run CLI help from repository root
94109

95-
# Testing
110+
# MCP testing
96111
pnpm -w run cli --transport stdio "q" # Test MCP tools
97112
pnpm -w run cli --transport stdio --access-token=TOKEN "q"
98113

@@ -121,12 +136,14 @@ Use `/dex` skill to coordinate complex work. Create tasks with full context, bre
121136
1. Check neighboring files for existing patterns before writing new code.
122137
2. When adding or modifying Sentry API endpoint usage, ALWAYS validate the endpoint behavior against the Sentry source code in `~/src/sentry` instead of assuming docs or client parameters are authoritative.
123138
3. Update relevant docs when changing functionality.
124-
4. Follow docs/contributing/error-handling.md for error types.
139+
4. Follow docs/contributing/error-handling.md for MCP error types and
140+
packages/cli/src/lib/errors.ts for CLI error classes.
125141
5. Follow docs/contributing/pr-management.md for commits and PRs.
126142

127143
## Commit Attribution
128144

129145
AI commits MUST include:
146+
130147
```
131148
Co-Authored-By: (the agent model's name and attribution byline)
132149
```

‎README.md‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# sentry-mcp
1+
# Sentry Toolkit
2+
3+
This repository contains the Sentry CLI, the Sentry MCP server, and shared
4+
packages. For the CLI, see the [CLI guide](docs/cli/README.md) and the published
5+
documentation at <https://cli.sentry.dev/>. The [documentation index](docs/README.md)
6+
covers both products and shared contributor guidance.
7+
8+
## Sentry MCP
29

310
Sentry's MCP service is primarily designed for human-in-the-loop coding agents. Our tool selection and priorities are focused on developer workflows and debugging use cases, rather than providing a general-purpose MCP server for all Sentry functionality.
411

@@ -267,6 +274,7 @@ pnpm -w run cli --access-token=TOKEN "query"
267274
Note: The CLI defaults to `http://localhost:5173`. Override with `--mcp-host` or set `MCP_URL` environment variable.
268275

269276
**Comprehensive testing playbooks:**
277+
270278
- **Stdio testing:** See `docs/testing/stdio.md` for complete guide on building, running, and testing the stdio implementation (IDEs, MCP Inspector)
271279
- **Remote testing:** See `docs/testing/remote.md` for complete guide on testing the remote server (OAuth, web UI, CLI client)
272280

@@ -287,4 +295,6 @@ When addressing automated feedback, focus on the underlying concerns rather than
287295

288296
### Contributor Documentation
289297

290-
Looking to contribute or explore the full documentation map? See `CLAUDE.md` (also available as `AGENTS.md`) for contributor workflows and the complete docs index. The `docs/` folder contains the per-topic guides and tool-integrated `.md` files.
298+
Looking to contribute? Start at the [Toolkit documentation index](docs/README.md)
299+
for CLI, MCP, and shared guides. See `AGENTS.md` for repository rules and
300+
`packages/cli/AGENTS.md` for CLI-specific rules.

‎docs/README.md‎

Lines changed: 39 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,39 @@
1-
# Contributor Docs
2-
3-
This directory contains contributor documentation used by humans and LLMs. The
4-
canonical workflow and required docs live in [../AGENTS.md](../AGENTS.md)
5-
(`CLAUDE.md` is a symlink to the same file).
6-
7-
## Start Here
8-
9-
- Tool implementation: [contributing/adding-tools.md](contributing/adding-tools.md)
10-
- Tool output policy: [contributing/tool-responses.md](contributing/tool-responses.md)
11-
- Testing: [testing/overview.md](testing/overview.md)
12-
- Shared implementation patterns: [contributing/common-patterns.md](contributing/common-patterns.md)
13-
14-
## Topic Map
15-
16-
### Contributing
17-
18-
- [contributing/adding-tools.md](contributing/adding-tools.md) - Tool structure, visibility, implementation, and registration
19-
- [contributing/api-patterns.md](contributing/api-patterns.md) - Sentry API client and MSW patterns
20-
- [contributing/coding-guidelines.md](contributing/coding-guidelines.md) - TypeScript and code style guidance
21-
- [contributing/common-patterns.md](contributing/common-patterns.md) - Shared Zod, validation, and formatting patterns
22-
- [contributing/documentation-style-guide.md](contributing/documentation-style-guide.md) - Documentation style guide
23-
- [contributing/error-handling.md](contributing/error-handling.md) - Error hierarchy and propagation
24-
- [contributing/pr-management.md](contributing/pr-management.md) - Commit and PR guidelines
25-
- [contributing/quality-checks.md](contributing/quality-checks.md) - Quality gates and pre-commit checks
26-
- [contributing/search-events-api-patterns.md](contributing/search-events-api-patterns.md) - Search Events API guidance
27-
- [contributing/tool-responses.md](contributing/tool-responses.md) - User-facing tool output policy, snapshot review, and QA expectations
28-
29-
### Testing
30-
31-
- [testing/overview.md](testing/overview.md) - Unit, snapshot, eval, and agent CLI testing
32-
- [testing/stdio.md](testing/stdio.md) - Stdio transport testing
33-
- [testing/remote.md](testing/remote.md) - Remote server and OAuth testing
34-
35-
### Architecture And Operations
36-
37-
- [architecture/overview.md](architecture/overview.md) - System design
38-
- [operations/embedded-agents.md](operations/embedded-agents.md) - Embedded LLM provider configuration
39-
- [operations/github-actions.md](operations/github-actions.md) - GitHub Actions guidance
40-
- [operations/logging.md](operations/logging.md) - Logging guidance
41-
- [operations/monitoring.md](operations/monitoring.md) - Monitoring guidance
42-
- [operations/oauth-signout-playbook.md](operations/oauth-signout-playbook.md) - Remote OAuth diagnostic runbook
43-
- [operations/security.md](operations/security.md) - Authentication and security patterns
44-
- [operations/stdio-auth.md](operations/stdio-auth.md) - Device code auth and token caching
45-
- [operations/token-cost-tracking.md](operations/token-cost-tracking.md) - Tool definition token cost tracking
46-
47-
### Cloudflare
48-
49-
- [cloudflare/overview.md](cloudflare/overview.md) - Cloudflare package overview
50-
- [cloudflare/architecture.md](cloudflare/architecture.md) - Cloudflare architecture
51-
- [cloudflare/oauth-architecture.md](cloudflare/oauth-architecture.md) - Cloudflare OAuth architecture
52-
53-
### Integrations
54-
55-
- [integrations/claude-code-plugin.md](integrations/claude-code-plugin.md) - Plugin structure and agent prompts
56-
- [integrations/ide-instructions-refactor.md](integrations/ide-instructions-refactor.md) - IDE instruction refactor notes
57-
58-
### Specs
59-
60-
- [specs/README.md](specs/README.md) - Specs index
61-
- [specs/alert-rules.md](specs/alert-rules.md) - Alert inspection, editing, options, and connected sources
62-
- [specs/embedded-agent-openai-routing.md](specs/embedded-agent-openai-routing.md) - Embedded agent OpenAI routing spec
63-
- [specs/project-management.md](specs/project-management.md) - Project management tools spec
64-
- [specs/remembered-oauth-skills.md](specs/remembered-oauth-skills.md) - Remembered OAuth skill defaults spec
65-
- [specs/search-events.md](specs/search-events.md) - Search Events spec
66-
- [specs/sentry-bearer-cloudflare-auth.md](specs/sentry-bearer-cloudflare-auth.md) - Direct Sentry token auth for the Cloudflare transport
67-
- [specs/subpath-constraints.md](specs/subpath-constraints.md) - Subpath constraints spec
68-
69-
### Releases
70-
71-
- [releases/stdio.md](releases/stdio.md) - npm package release
72-
- [releases/cloudflare.md](releases/cloudflare.md) - Cloudflare deployment
73-
74-
## Maintenance
75-
76-
Update docs when patterns change, new tools are added, or common issues arise.
77-
Prefer cross-links over duplicated guidance: topic docs should link to the
78-
canonical policy or pattern that owns the detail.
1+
# Toolkit Documentation
2+
3+
This directory is the documentation home for the Toolkit repository. It covers
4+
the Sentry CLI, the MCP server, and the code they share. Start with the product
5+
you are working on:
6+
7+
- [Sentry CLI](cli/README.md) — commands, contributor guides, generated docs,
8+
and the published CLI documentation site.
9+
- [Sentry MCP](mcp/README.md) — tools, transports, Cloudflare, operations, and
10+
MCP-specific tests and specs.
11+
12+
The published CLI site lives in `apps/cli-docs/` because CLI releases build
13+
and package it from that workspace. The contributor index here links to its
14+
source and to <https://cli.sentry.dev/>. MCP documentation lives in the topic
15+
directories below; the MCP index explains which guides apply to that product.
16+
17+
## Shared Contributor Guides
18+
19+
- [Coding guidelines](contributing/coding-guidelines.md) — repository-wide style
20+
and the separate CLI and MCP patterns.
21+
- [Documentation style](contributing/documentation-style-guide.md) — how to
22+
write and link Toolkit docs.
23+
- [Pull requests](contributing/pr-management.md) — contribution and review
24+
workflow.
25+
- [Quality checks](contributing/quality-checks.md) — repository checks before
26+
a change is proposed.
27+
28+
For package-specific rules, see the root [AGENTS.md](../AGENTS.md) and the
29+
[CLI AGENTS.md](../packages/cli/AGENTS.md). `packages/toolkit-core/` contains
30+
shared primitives used by both products.
31+
32+
## Ownership
33+
34+
Keep repository-wide contributor guidance in `docs/contributing/`. Put product
35+
guides under the relevant product index, and link to existing material rather
36+
than copying it. CLI website pages and generated command documentation remain
37+
in `apps/cli-docs/`; changes there follow the CLI documentation build and
38+
release. Root `docs/` changes run the repository documentation checks; they do
39+
not deploy a website or select a product build on their own.

‎docs/cli/README.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Sentry CLI Documentation
2+
3+
The CLI lives in `packages/cli/`. Its published user guide and command reference
4+
are at <https://cli.sentry.dev/>. The site source lives in `apps/cli-docs/`, and
5+
CLI releases build it from that workspace. Start here for repository guides:
6+
7+
- [Getting started](../../apps/cli-docs/src/content/docs/getting-started.mdx),
8+
[features](../../apps/cli-docs/src/content/docs/features.md), and
9+
[self-hosted use](../../apps/cli-docs/src/content/docs/self-hosted.md) —
10+
hand-written user guides.
11+
- [Contributing to the CLI](../../apps/cli-docs/src/content/docs/contributing.md)
12+
— setup, generated project layout, testing, and builds.
13+
- [CLI development notes](../../packages/cli/DEVELOPMENT.md) and
14+
[command conventions](../../packages/cli/CONTRIBUTING.md) — implementation
15+
details and command design.
16+
- [CLI build workflow](../../.github/workflows/cli-build.yml) and
17+
[release configuration](../../.craft.yml) — binaries, npm packaging, and
18+
release-gated website artifacts.
19+
- [CLI AGENTS.md](../../packages/cli/AGENTS.md) — package-specific coding and
20+
testing rules.
21+
- [CLI docs fragments](../../apps/cli-docs/src/fragments/commands/index.md)
22+
— hand-written additions to generated command pages. Command metadata and
23+
examples belong to the commands; the generated pages are not checked in.
24+
- [CLI overview](../../packages/cli/README.md) — installation, supported
25+
platforms, and library use.
26+
27+
Run CLI commands from `packages/cli/` or use `pnpm --filter sentry run <script>`
28+
at the repository root. Check `packages/cli/package.json` for current scripts
29+
before running them. The CLI docs workspace uses `pnpm --filter sentry-cli-docs`
30+
and depends on generated CLI documentation. The root
31+
[coding guidelines](../contributing/coding-guidelines.md) and
32+
[quality checks](../contributing/quality-checks.md) apply alongside the CLI's
33+
own rules.

‎docs/contributing/coding-guidelines.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Coding Guidelines
22

3-
Essential patterns and standards for Sentry MCP development.
3+
Repository-wide TypeScript and style guidance for Toolkit. See the
4+
[CLI guide](../cli/README.md) and [MCP guide](../mcp/README.md) for
5+
product-specific implementation patterns.
46

57
## TypeScript Configuration
68

@@ -51,7 +53,7 @@ import { mockData } from "@sentry-mcp/mocks";
5153
import { UserInputError } from "./errors.js";
5254
```
5355

54-
## Tool Implementation
56+
## MCP Tool Implementation
5557

5658
```typescript
5759
export const toolName = {

0 commit comments

Comments
 (0)