You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Coming soon.
112
112
113
113
Coming soon.
114
114
115
-
## Getting Started
115
+
## Getting started
116
116
117
117
Each example includes its own README with setup instructions. Generally:
118
118
@@ -123,3 +123,48 @@ Each example includes its own README with setup instructions. Generally:
123
123
124
124
See individual example READMEs for detailed instructions.
125
125
126
+
## MCP manifest architecture
127
+
128
+
This repository serves as the **single source of truth** for PostHog integration resources accessed via the [PostHog MCP server](https://github.com/PostHog/posthog/tree/main/products/mcp).
129
+
130
+
### How it works
131
+
132
+
1.**Build process** (`npm run build:docs`):
133
+
- Converts example projects to markdown
134
+
- Discovers workflow guides from `llm-prompts/`
135
+
- Discovers MCP prompts from `mcp-commands/`
136
+
- Generates `manifest.json` with all URIs and metadata
137
+
- Packages everything into `examples-mcp-resources.zip`
138
+
139
+
2.**MCP server** (runtime):
140
+
- Fetches the ZIP from GitHub releases
141
+
- Loads `manifest.json`
142
+
-**Purely reflects** the manifest - no hardcoded URIs or logic
143
+
144
+
### Manifest structure
145
+
146
+
The manifest defines:
147
+
-**Workflows**: Step-by-step guides with automatic next-step linking
148
+
-**Docs**: PostHog documentation URLs
149
+
-**Prompts**: MCP command prompts with template variable substitution
150
+
-**Templates**: Resource templates for parameterized access (e.g., `posthog://examples/{framework}`)
151
+
152
+
### Adding new resources
153
+
154
+
**Workflows**: Add markdown files to `llm-prompts/[category]/` following the naming convention `[order].[step]-[name].md`
155
+
156
+
**Examples**: Add new example projects to `basics/` and configure in `scripts/build-examples-mcp-resources.js`
157
+
158
+
**Prompts**: Add JSON files to `mcp-commands/`
159
+
160
+
The build script automatically discovers, orders, and generates URIs for all resources.
161
+
162
+
### Why this architecture?
163
+
164
+
-**Single source of truth**: All URIs defined in examples repo
165
+
-**Zero hardcoding**: MCP server has no URIs or business logic
166
+
-**Easy to extend**: Add resources by creating properly named files
167
+
-**Version controlled**: Resources evolve with the examples
168
+
169
+
See `llm-prompts/README.md` for detailed workflow conventions.
This directory contains LLM workflow prompts that guide AI agents through various PostHog integration tasks.
3
+
This directory contains LLM workflow prompts that guide AI agents through PostHog integration tasks.
4
4
5
5
Feel free to try these out directly, or summon them from the PostHog MCP server. You can also use them as a starting point for your own deep integrations. We've tested these extensively.
6
6
7
7
## Structure
8
8
9
9
-**basic-integration/**: Step-by-step workflow guides for adding PostHog event tracking to a project
10
-
-`1.0-event-setup-begin.md`: Initial project analysis and event planning
11
-
-`1.1-event-setup-edit.md`: Implementation guidance for adding PostHog tracking
12
-
-`1.2-event-setup-revise.md`: Error checking and correction
10
+
-`1.0-begin.md`: Initial project analysis and event planning
11
+
-`1.1-edit.md`: Implementation guidance for adding PostHog tracking
12
+
-`1.2-revise.md`: Error checking and correction
13
13
14
-
## Manifest-Driven Architecture
14
+
## Manifest-driven architecture
15
15
16
16
These prompts and their URIs are defined in `manifest.json`, which is generated during the build process. The manifest is the **source of truth** for all resource URIs and metadata.
1. Create a new category directory: `llm-prompts/[category]/`
67
67
2. Add markdown files following the naming convention
68
68
3. Files are automatically:
69
69
- Discovered and ordered
70
70
- Linked to next steps
71
-
- Given URIs (e.g., `posthog://workflows/[category]-[name]`)
71
+
- Given URIs (e.g., `posthog://workflows/[category]/[name]`)
72
72
- Added to the manifest
73
73
74
74
**No configuration needed!** Just add properly named files.
75
75
76
-
## Build Process
76
+
## Build process
77
77
78
78
These prompts are packaged into the release artifact `examples-mcp-resources.zip`.
79
79
@@ -85,9 +85,9 @@ npm run build:docs
85
85
86
86
The MCP server fetches these prompts from the latest GitHub release and serves them as resources to AI agents and the PostHog wizard during integration tasks.
87
87
88
-
## Architecture Benefits
88
+
## Architecture benefits
89
89
90
90
-**Single source of truth**: Examples repo controls all URIs
91
91
-**No hardcoded URIs in MCP**: MCP purely reflects manifest
92
-
-**Easy to extend**: Add resources by updating manifest config
92
+
-**Easy to extend**: Add resources by creating properly named files
93
93
-**Version controlled**: URIs and metadata evolve with the examples
0 commit comments