Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _claude-integration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
89 changes: 89 additions & 0 deletions _claude-integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# @agentation/claude

Claude Code integration for [Agentation](https://agentation.dev) - sync page feedback directly to Claude Code via MCP.

## Setup

### 1. Add the MCP server to Claude Code

```bash
claude mcp add agentation -- npx @agentation/claude
```

That's it! The server will auto-start when you launch Claude Code.

### 2. Configure Agentation in your app

```tsx
import { Agentation } from 'agentation';

function App() {
return (
<>
<YourApp />
{process.env.NODE_ENV === 'development' && (
<Agentation serverUrl="http://localhost:4242" />
)}
</>
);
}
```

## Usage

1. **Start Claude Code** - the MCP server starts automatically
2. **Browse your app** and annotate issues with Agentation
3. **Tell Claude** to check your feedback:
- "Check my page feedback"
- "What UI issues do I have?"
- "Fix the issues on /dashboard"

Claude will query the MCP server and see your structured annotations.

## How it works

```
Browser (your app) Your Machine Claude Code
│ │ │
│ POST localhost:4242 │ │
└──────────────────────────►│ HTTP Server │
│ │ │
│ ▼ │
│ In-Memory Store │
│ │ │
│ MCP Server ◄────────────┘
│ (stdio) MCP Protocol
```

- **HTTP Server** (port 4242): Receives annotations from browser
- **MCP Server** (stdio): Exposes tools to Claude Code
- **Shared Store**: In-memory, cleared when server restarts

## MCP Tools

| Tool | Description |
|------|-------------|
| `agentation_get_feedback` | Get all annotations, optionally filtered by pathname |
| `agentation_list_pages` | List pages with pending feedback |
| `agentation_clear_feedback` | Clear feedback after processing |

## CLI Options

```bash
npx @agentation/claude [options]

Options:
--port <number> HTTP server port (default: 4242)
--verbose, -v Enable verbose logging
```

## Custom port

```bash
claude mcp add agentation -- npx @agentation/claude --port 5000
```

Then configure your app:
```tsx
<Agentation serverUrl="http://localhost:5000" />
```
36 changes: 36 additions & 0 deletions _claude-integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@agentation/claude",
"version": "0.0.1",
"description": "Claude Code integration for Agentation - MCP server for syncing page feedback",
"license": "PolyForm-Shield-1.0.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
"agentation-claude": "./dist/cli.js"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"watch": "tsup --watch",
"dev": "tsx src/cli.ts",
"start": "node dist/cli.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.12.1"
},
"devDependencies": {
"tsup": "^8.0.0",
"tsx": "^4.7.0",
"typescript": "^5.0.0",
"@types/node": "^20.0.0"
}
}
20 changes: 20 additions & 0 deletions _claude-integration/src/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { startServer } from "./server.js";

const args = process.argv.slice(2);

// Parse CLI arguments
const portIndex = args.indexOf("--port");
const port = portIndex !== -1 ? parseInt(args[portIndex + 1], 10) : 4242;
const verbose = args.includes("--verbose") || args.includes("-v");

console.error(`
Agentation Claude Integration
==============================
HTTP server: http://localhost:${port}
MCP server: stdio (connected to Claude Code)
`);

startServer({ httpPort: port, verbose }).catch((err) => {
console.error("[agentation] Fatal error:", err);
process.exit(1);
});
21 changes: 21 additions & 0 deletions _claude-integration/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @agentation/claude
*
* Claude Code integration for Agentation - MCP server for syncing page feedback
*
* Usage as CLI (recommended):
* claude mcp add agentation -- npx @agentation/claude
*
* Usage programmatically:
* import { startServer } from '@agentation/claude';
* await startServer({ httpPort: 4242 });
*/

export { startServer } from "./server.js";
export { store } from "./store.js";
export type {
Annotation,
PageFeedback,
SyncPayload,
ServerConfig,
} from "./types.js";
Loading