fly-agent-mcp 1.0.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.
Files changed (3) hide show
  1. package/README.md +86 -0
  2. package/index.js +119 -0
  3. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Fly Agent MCP Proxy
2
+
3
+ Connect Claude Desktop to Fly Agent's Google Business Profile management tools via MCP (Model Context Protocol).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @anthropic-fly/mcp-proxy
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ ### 1. Get your API Key
14
+
15
+ 1. Log in to [fly-social.com](https://app.fly-social.com)
16
+ 2. Go to Settings → Integrations → API Keys
17
+ 3. Generate a new API key (starts with `fly_sk_...`)
18
+
19
+ ### 2. Configure Claude Desktop
20
+
21
+ Edit your Claude Desktop config file:
22
+
23
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
24
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "fly-agent": {
30
+ "command": "fly-mcp",
31
+ "env": {
32
+ "FLY_API_KEY": "fly_sk_your_api_key_here",
33
+ "FLY_ENV": "main"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ### 3. Restart Claude Desktop
41
+
42
+ The Fly Agent tools will now be available in Claude Desktop.
43
+
44
+ ## Environment Variables
45
+
46
+ | Variable | Required | Description |
47
+ |----------|----------|-------------|
48
+ | `FLY_API_KEY` | Yes | Your Fly Agent API key |
49
+ | `FLY_ENV` | No | Environment: `dev`, `staging`, or `main` (default: `dev`) |
50
+ | `FLY_MCP_URL` | No | Custom MCP server URL (overrides FLY_ENV) |
51
+
52
+ ## Available Tools
53
+
54
+ Once connected, you can ask Claude to:
55
+
56
+ - **Reviews**: Get recent reviews, respond to reviews, view review stats
57
+ - **Profile**: View and update your Google Business Profile
58
+ - **Content**: Generate and publish posts to your GBP
59
+ - **Rankings**: Track local keyword rankings
60
+ - **Performance**: View performance metrics and insights
61
+ - **Reports**: Generate monthly performance reports
62
+ - And 130+ more tools...
63
+
64
+ ## Example Prompts
65
+
66
+ - "Show me my recent reviews"
67
+ - "What's my average rating?"
68
+ - "Generate a post about our weekend special"
69
+ - "Show my performance stats for the last 30 days"
70
+ - "What keywords am I ranking for?"
71
+
72
+ ## Troubleshooting
73
+
74
+ ### Claude Desktop hangs on startup
75
+
76
+ Try using the local Python transport instead (see main documentation).
77
+
78
+ ### "Invalid API key" error
79
+
80
+ 1. Verify your API key is correct
81
+ 2. Check it hasn't expired
82
+ 3. Ensure you have at least one location connected
83
+
84
+ ## License
85
+
86
+ MIT
package/index.js ADDED
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MCP Proxy for Fly Agent
4
+ *
5
+ * Bridges Claude Desktop (stdio) to remote Fly Agent MCP server (SSE).
6
+ *
7
+ * Usage:
8
+ * FLY_API_KEY=fly_sk_xxx node index.js
9
+ */
10
+
11
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
12
+ import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
13
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
14
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
+ import {
16
+ ListToolsRequestSchema,
17
+ CallToolRequestSchema,
18
+ ListResourcesRequestSchema,
19
+ ReadResourceRequestSchema,
20
+ ListPromptsRequestSchema,
21
+ GetPromptRequestSchema,
22
+ } from "@modelcontextprotocol/sdk/types.js";
23
+
24
+ const API_KEY = process.env.FLY_API_KEY;
25
+ const FLY_ENV = process.env.FLY_ENV || "dev";
26
+
27
+ // Map FLY_ENV to Cloud Run URLs
28
+ const ENV_URLS = {
29
+ dev: "https://fly-agent-dev-mcp-681315111540.asia-south1.run.app/mcp/sse",
30
+ staging: "https://fly-agent-staging-681315111540.asia-south1.run.app/mcp/sse",
31
+ main: "https://fly-agent-main-681315111540.asia-south1.run.app/mcp/sse",
32
+ };
33
+
34
+ const MCP_URL = process.env.FLY_MCP_URL || ENV_URLS[FLY_ENV] || ENV_URLS.dev;
35
+
36
+ if (!API_KEY) {
37
+ console.error("Error: FLY_API_KEY environment variable required");
38
+ process.exit(1);
39
+ }
40
+
41
+ // Create local stdio server
42
+ const server = new Server(
43
+ { name: "fly-agent-proxy", version: "1.0.0" },
44
+ { capabilities: { tools: {}, resources: {}, prompts: {} } }
45
+ );
46
+
47
+ // Remote client
48
+ let remoteClient = null;
49
+
50
+ async function connectToRemote() {
51
+ if (remoteClient) return remoteClient;
52
+
53
+ console.error("Connecting to remote MCP server...");
54
+
55
+ const transport = new SSEClientTransport(new URL(MCP_URL), {
56
+ requestInit: {
57
+ headers: {
58
+ "X-API-Key": API_KEY,
59
+ },
60
+ },
61
+ });
62
+
63
+ remoteClient = new Client(
64
+ { name: "fly-agent-proxy-client", version: "1.0.0" },
65
+ { capabilities: {} }
66
+ );
67
+
68
+ await remoteClient.connect(transport);
69
+ console.error("Connected to remote MCP server:", MCP_URL);
70
+ return remoteClient;
71
+ }
72
+
73
+ // Proxy tool listing
74
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
75
+ const client = await connectToRemote();
76
+ return await client.listTools();
77
+ });
78
+
79
+ // Proxy tool calls
80
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
81
+ const client = await connectToRemote();
82
+ return await client.callTool(request.params);
83
+ });
84
+
85
+ // Proxy resource listing
86
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
87
+ const client = await connectToRemote();
88
+ return await client.listResources();
89
+ });
90
+
91
+ // Proxy resource reading
92
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
93
+ const client = await connectToRemote();
94
+ return await client.readResource(request.params);
95
+ });
96
+
97
+ // Proxy prompt listing
98
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
99
+ const client = await connectToRemote();
100
+ return await client.listPrompts();
101
+ });
102
+
103
+ // Proxy prompt getting
104
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
105
+ const client = await connectToRemote();
106
+ return await client.getPrompt(request.params);
107
+ });
108
+
109
+ // Start the local stdio server
110
+ async function main() {
111
+ const transport = new StdioServerTransport();
112
+ await server.connect(transport);
113
+ console.error(`MCP proxy started - env: ${FLY_ENV}, bridging to`, MCP_URL);
114
+ }
115
+
116
+ main().catch((error) => {
117
+ console.error("Fatal error:", error);
118
+ process.exit(1);
119
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "fly-agent-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP proxy for Fly Agent - connects Claude Desktop to Fly Agent's remote MCP server",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "fly-mcp": "./index.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node index.js"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "fly-agent",
17
+ "claude",
18
+ "google-business-profile",
19
+ "gbp"
20
+ ],
21
+ "author": "Fly Social",
22
+ "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/ZoomLocal-Tech/fly-agent"
26
+ },
27
+ "engines": {
28
+ "node": ">=18.0.0"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/sdk": "^1.0.0"
32
+ }
33
+ }