@agentaeo/mcp-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @agentaeo/mcp-server
2
+
3
+ MCP (Model Context Protocol) server for [AgentAEO](https://agentaeo.com) — run AEO (Answer Engine Optimization) audits across ChatGPT, Perplexity, Claude, and Google AI.
4
+
5
+ **Source:** [`agentaeo/agentaeo-mcp-server`](https://github.com/agentaeo/agentaeo-mcp-server) on GitHub (local folder name: `agentaeo-mcp-server`).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @agentaeo/mcp-server
11
+ # or
12
+ npx @agentaeo/mcp-server
13
+ ```
14
+
15
+ ## Configuration
16
+
17
+ Set your API key (get one at [agentaeo.com/agents](https://agentaeo.com/agents)):
18
+
19
+ ```bash
20
+ export AGENTAEO_API_KEY=your_api_key_here
21
+ ```
22
+
23
+ ## Claude Desktop
24
+
25
+ Config file on macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
26
+
27
+ ### After publishing to npm (recommended)
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "agentaeo": {
33
+ "command": "npx",
34
+ "args": ["-y", "@agentaeo/mcp-server"],
35
+ "env": {
36
+ "AGENTAEO_API_KEY": "your_api_key_here"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ `-y` skips npx’s “Ok to proceed?” prompt (important for GUI-launched processes).
44
+
45
+ ### Local dev (before publish)
46
+
47
+ **Prefer `node` + `dist/index.js`** — `npx` + a local `.tgz` often breaks in Claude Desktop (npm path bugs, “tarball corrupted”, or `Permission denied` when the shell mishandles the archive). Avoid `.tgz` in the MCP config unless you’ve verified it on your machine.
48
+
49
+ 1. In the repo: `npm install` and `npm run build` (must produce `dist/index.js`).
50
+ 2. Use your **real** AgentAEO key in `AGENTAEO_API_KEY` (not the literal text `your_real_key_here`).
51
+
52
+ **Recommended — `node` + absolute path to `dist/index.js`:**
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "agentaeo": {
58
+ "command": "node",
59
+ "args": ["/Users/aashishn/agents/agentaeo-mcp-server/dist/index.js"],
60
+ "env": {
61
+ "AGENTAEO_API_KEY": "paste_your_agentaeo_live_key_here"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ If `node` is not on Claude’s PATH (e.g. only nvm), use the full path to node, e.g. `"/Users/aashishn/.nvm/versions/node/v22.16.0/bin/node"` as `command` and the same `args` for `dist/index.js`.
69
+
70
+ **Optional — tarball via npx** (only if `node` works from Terminal but you prefer npx): some setups need `file:` prefix — ask in Terminal first:
71
+ `npx -y file:/Users/aashishn/agents/agentaeo-mcp-server/agentaeo-mcp-server-0.1.0.tgz` — if that fails, stick to `node` + `dist`.
72
+
73
+ After editing the config, **fully quit Claude Desktop** (Cmd+Q) and reopen. Check **Settings → Developer → Local MCP servers** for a green status.
74
+
75
+ ## Tools
76
+
77
+ | Tool | Description |
78
+ |------|-------------|
79
+ | `run_aeo_audit` | Run an AEO audit for a URL. Free: 8 queries. Paid: 40 queries with full blueprint. |
80
+ | `check_aeo_audit_status` | Poll audit status and retrieve results. Use the `auditId` from `run_aeo_audit`. |
81
+
82
+ ## Example
83
+
84
+ Ask Claude: *"Run a free AEO audit for agentaeo.com with keyword 'AI search visibility'"*
85
+
86
+ Then: *"Check the status of that audit"* (Claude will use the returned auditId)
87
+
88
+ ## Requirements
89
+
90
+ - Node.js 18+
91
+ - AgentAEO API key from [agentaeo.com/agents](https://agentaeo.com/agents)
92
+
93
+ ## Development & publishing
94
+
95
+ Run all **npm** commands from the repo root (the folder that contains `package.json`), e.g.:
96
+
97
+ ```bash
98
+ cd ~/agents/agentaeo-mcp-server # or your path to agentaeo-mcp-server
99
+ npm install
100
+ npm run build
101
+ npm pack # optional: test tarball before publish
102
+ ```
103
+
104
+ Publish (after `npm login` and scope access for `@agentaeo`):
105
+
106
+ ```bash
107
+ npm publish --access public
108
+ ```
109
+
110
+ **GitHub vs npm:** The GitHub repo can stay **private**; the **npm package** `@agentaeo/mcp-server` is usually **public** so `npx @agentaeo/mcp-server` works for everyone. Those are independent settings.
111
+
112
+ ## License
113
+
114
+ MIT
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @agentaeo/mcp-server — MCP server for AgentAEO
4
+ * Run AEO audits across ChatGPT, Perplexity, Claude, and Google AI.
5
+ *
6
+ * Requires: AGENTAEO_API_KEY environment variable
7
+ * Get your key at: https://agentaeo.com/agents
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}
package/dist/index.js ADDED
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @agentaeo/mcp-server — MCP server for AgentAEO
4
+ * Run AEO audits across ChatGPT, Perplexity, Claude, and Google AI.
5
+ *
6
+ * Requires: AGENTAEO_API_KEY environment variable
7
+ * Get your key at: https://agentaeo.com/agents
8
+ */
9
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
10
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
+ import { z } from "zod";
12
+ const API_BASE = "https://agentaeo-api.onrender.com";
13
+ function getApiKey() {
14
+ const key = process.env.AGENTAEO_API_KEY?.trim();
15
+ if (!key) {
16
+ console.error("[agentaeo-mcp-server] ERROR: AGENTAEO_API_KEY is required but not set.\n" +
17
+ "Get your API key at https://agentaeo.com/agents and set it:\n" +
18
+ " export AGENTAEO_API_KEY=your_key_here\n" +
19
+ "Or add it to your Claude Desktop config: env.AGENTAEO_API_KEY");
20
+ process.exit(1);
21
+ }
22
+ return key;
23
+ }
24
+ async function main() {
25
+ const apiKey = getApiKey();
26
+ const server = new McpServer({
27
+ name: "agentaeo",
28
+ version: "0.1.0",
29
+ });
30
+ server.tool("run_aeo_audit", "Run an AEO audit for a URL. Tests visibility across ChatGPT, Perplexity, Claude, and Google AI. Free tier: 8 queries. Paid tier: 40 queries with full blueprint.", {
31
+ url: z.string().url().describe("The website URL to audit (e.g. https://example.com)"),
32
+ keyword: z.string().optional().describe("Primary industry keyword for query generation (e.g. payment API)"),
33
+ tier: z.enum(["free", "paid"]).optional().default("free").describe("Audit tier: free (8 queries) or paid (40 queries)"),
34
+ }, async ({ url, keyword, tier }) => {
35
+ try {
36
+ const res = await fetch(`${API_BASE}/api/aeo-audit`, {
37
+ method: "POST",
38
+ headers: {
39
+ "Content-Type": "application/json",
40
+ "X-API-Key": apiKey,
41
+ },
42
+ body: JSON.stringify({ url, keyword: keyword || "", tier: tier || "free" }),
43
+ });
44
+ const data = (await res.json());
45
+ if (!res.ok) {
46
+ const err = data?.error || data?.message || `HTTP ${res.status}`;
47
+ return {
48
+ content: [{ type: "text", text: `Error: ${err}` }],
49
+ isError: true,
50
+ };
51
+ }
52
+ const auditId = (data?.auditId ?? data?.audit_id ?? data?.id);
53
+ const status = data?.status ?? "queued";
54
+ const text = auditId
55
+ ? `Audit started. auditId: ${auditId}\nStatus: ${status}\nUse check_aeo_audit_status with this auditId to poll for results.`
56
+ : JSON.stringify(data, null, 2);
57
+ return {
58
+ content: [{ type: "text", text }],
59
+ };
60
+ }
61
+ catch (err) {
62
+ const msg = err instanceof Error ? err.message : String(err);
63
+ return {
64
+ content: [{ type: "text", text: `Error: ${msg}` }],
65
+ isError: true,
66
+ };
67
+ }
68
+ });
69
+ server.tool("check_aeo_audit_status", "Check the status and results of an AEO audit. Poll this with the auditId returned from run_aeo_audit until status is completed.", {
70
+ auditId: z.string().describe("The audit ID returned from run_aeo_audit"),
71
+ }, async ({ auditId }) => {
72
+ try {
73
+ const res = await fetch(`${API_BASE}/api/aeo-status/${auditId}`, {
74
+ method: "GET",
75
+ headers: {
76
+ "X-API-Key": apiKey,
77
+ },
78
+ });
79
+ const data = (await res.json());
80
+ if (!res.ok) {
81
+ const err = data?.error || data?.message || `HTTP ${res.status}`;
82
+ return {
83
+ content: [{ type: "text", text: `Error: ${err}` }],
84
+ isError: true,
85
+ };
86
+ }
87
+ const status = data?.status ?? (data?.current_step != null ? "processing" : "unknown");
88
+ const isComplete = data?.is_complete ?? (data?.status === "completed");
89
+ const score = data?.score;
90
+ const grade = data?.grade;
91
+ let text = `Status: ${status}\nis_complete: ${isComplete}`;
92
+ if (score != null)
93
+ text += `\nScore: ${score}`;
94
+ if (grade)
95
+ text += `\nGrade: ${grade}`;
96
+ if (isComplete && data?.findings) {
97
+ text += `\n\nFull results:\n${JSON.stringify(data, null, 2)}`;
98
+ }
99
+ else {
100
+ text += `\n\nRaw response:\n${JSON.stringify(data, null, 2)}`;
101
+ }
102
+ return {
103
+ content: [{ type: "text", text }],
104
+ };
105
+ }
106
+ catch (err) {
107
+ const msg = err instanceof Error ? err.message : String(err);
108
+ return {
109
+ content: [{ type: "text", text: `Error: ${msg}` }],
110
+ isError: true,
111
+ };
112
+ }
113
+ });
114
+ const transport = new StdioServerTransport();
115
+ await server.connect(transport);
116
+ }
117
+ main().catch((err) => {
118
+ console.error("[agentaeo-mcp-server] Fatal:", err);
119
+ process.exit(1);
120
+ });
121
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AAErD,SAAS,SAAS;IAChB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;IACjD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CA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IAAI,EAAE,QAAQ,EAAE,CAAC;gBACjC,IAAI,IAAI,sBAAsB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAChE,CAAC;iBAAM,CAAC;gBACN,IAAI,IAAI,sBAAsB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAChE,CAAC;YACD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC;aAC3C,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,CAAC;gBAC3D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,GAAG,CAAC,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@agentaeo/mcp-server",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for AgentAEO — run AEO audits across ChatGPT, Perplexity, Claude, and Google AI",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "bin": {
8
+ "agentaeo-mcp-server": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "keywords": [
22
+ "mcp",
23
+ "agentaeo",
24
+ "aeo",
25
+ "answer-engine-optimization",
26
+ "ai-search"
27
+ ],
28
+ "author": "AIMetica Solutions LLP <agents@agentaeo.com>",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/agentaeo/agentaeo-mcp-server.git"
33
+ },
34
+ "homepage": "https://agentaeo.com/agents",
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.27.0",
37
+ "zod": "^3.23.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20.0.0",
41
+ "typescript": "^5.0.0"
42
+ }
43
+ }