@attrove/mcp 0.0.1 → 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,196 @@
1
+ # @attrove/mcp
2
+
3
+ MCP (Model Context Protocol) server for Attrove. Enables AI assistants like Claude and Cursor to access your users' unified context from Gmail, Slack, Google Calendar, and more.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @attrove/mcp
9
+ # or
10
+ yarn add @attrove/mcp
11
+ # or
12
+ pnpm add @attrove/mcp
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ### Claude Desktop
18
+
19
+ Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "attrove": {
25
+ "command": "npx",
26
+ "args": ["@attrove/mcp"],
27
+ "env": {
28
+ "ATTROVE_API_KEY": "sk_...",
29
+ "ATTROVE_USER_ID": "user-uuid"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ### Cursor
37
+
38
+ Add to your Cursor MCP settings:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "attrove": {
44
+ "command": "npx",
45
+ "args": ["@attrove/mcp"],
46
+ "env": {
47
+ "ATTROVE_API_KEY": "sk_...",
48
+ "ATTROVE_USER_ID": "user-uuid"
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### Direct CLI Usage
56
+
57
+ ```bash
58
+ ATTROVE_API_KEY=sk_... ATTROVE_USER_ID=user-uuid npx @attrove/mcp
59
+ ```
60
+
61
+ ## Available Tools
62
+
63
+ ### `attrove_query`
64
+
65
+ Ask questions about the user's communications and get AI-generated answers.
66
+
67
+ **Parameters:**
68
+ - `query` (required): The question to ask
69
+ - `integration_ids` (optional): Filter to specific integration IDs (UUIDs, e.g., `["550e8400-e29b-41d4-a716-446655440000"]`)
70
+ - `include_sources` (optional): Include source snippets
71
+
72
+ **Example prompts:**
73
+ - "What did Sarah say about the Q4 budget?"
74
+ - "Summarize my meeting with the engineering team"
75
+ - "What are the action items from yesterday's standup?"
76
+
77
+ ### `attrove_search`
78
+
79
+ Search for specific messages or conversations.
80
+
81
+ **Parameters:**
82
+ - `query` (required): The search query
83
+ - `after_date` (optional): Only messages after this date (ISO 8601)
84
+ - `before_date` (optional): Only messages before this date
85
+ - `sender_domains` (optional): Filter by sender domains
86
+ - `include_body_text` (optional): Include message content (default: true)
87
+
88
+ **Example prompts:**
89
+ - "Find all emails about the product launch"
90
+ - "Show me conversations with the marketing team"
91
+
92
+ ### `attrove_integrations`
93
+
94
+ List the user's connected integrations.
95
+
96
+ **Parameters:** None
97
+
98
+ **Example prompts:**
99
+ - "What services are connected?"
100
+ - "Show me my integrations"
101
+
102
+ ## Environment Variables
103
+
104
+ | Variable | Required | Description |
105
+ |----------|----------|-------------|
106
+ | `ATTROVE_API_KEY` | Yes | Your Attrove API key (`sk_...`) |
107
+ | `ATTROVE_USER_ID` | Yes | User ID to scope API calls |
108
+ | `ATTROVE_BASE_URL` | No | Custom API base URL |
109
+ | `ATTROVE_DEBUG` | No | Set to `true` for verbose error logging |
110
+
111
+ ## Programmatic Usage
112
+
113
+ You can also use the server programmatically:
114
+
115
+ ```typescript
116
+ import { createServer, startServer } from '@attrove/mcp';
117
+
118
+ // Create a server instance
119
+ const server = createServer({
120
+ apiKey: 'sk_...',
121
+ userId: 'user-uuid'
122
+ });
123
+
124
+ // Or start directly with stdio transport
125
+ await startServer({
126
+ apiKey: 'sk_...',
127
+ userId: 'user-uuid'
128
+ });
129
+ ```
130
+
131
+ ## Getting API Credentials
132
+
133
+ 1. Sign up at [attrove.com](https://attrove.com)
134
+ 2. Create an organization in the dashboard
135
+ 3. Generate an API key (`sk_...`)
136
+ 4. Provision a user to get a user ID
137
+
138
+ ```typescript
139
+ import { Attrove } from '@attrove/sdk';
140
+
141
+ const admin = Attrove.admin({
142
+ clientId: 'your-client-id',
143
+ clientSecret: 'your-client-secret'
144
+ });
145
+
146
+ // Create a user
147
+ const { id, apiKey } = await admin.users.create({
148
+ email: 'user@example.com'
149
+ });
150
+
151
+ // Use `apiKey` as ATTROVE_API_KEY and `id` as ATTROVE_USER_ID
152
+ ```
153
+
154
+ ## Troubleshooting
155
+
156
+ ### "ATTROVE_API_KEY environment variable is required"
157
+
158
+ Make sure you've set the environment variables correctly in your MCP configuration.
159
+
160
+ ### Tools not showing up
161
+
162
+ 1. Restart Claude/Cursor after configuration changes
163
+ 2. Check the MCP server logs for errors
164
+ 3. Verify your API key is valid
165
+
166
+ ### Debugging errors
167
+
168
+ Set `ATTROVE_DEBUG=true` to enable verbose error logging with stack traces:
169
+
170
+ ```json
171
+ {
172
+ "mcpServers": {
173
+ "attrove": {
174
+ "command": "npx",
175
+ "args": ["@attrove/mcp"],
176
+ "env": {
177
+ "ATTROVE_API_KEY": "sk_...",
178
+ "ATTROVE_USER_ID": "user-uuid",
179
+ "ATTROVE_DEBUG": "true"
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ ### Rate limiting
187
+
188
+ The Attrove API has rate limits. If you're making many requests, you may need to wait before trying again.
189
+
190
+ ## Requirements
191
+
192
+ - Node.js 18.0.0 or later
193
+
194
+ ## License
195
+
196
+ MIT
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Attrove MCP Server CLI
5
+ *
6
+ * Starts the MCP server for use with Claude, Cursor, or other MCP-compatible clients.
7
+ *
8
+ * Required environment variables:
9
+ * - ATTROVE_API_KEY: Your Attrove API key (sk_...)
10
+ * - ATTROVE_USER_ID: The user ID to scope API calls
11
+ *
12
+ * Optional environment variables:
13
+ * - ATTROVE_BASE_URL: Custom API base URL (defaults to https://api.attrove.com)
14
+ * - ATTROVE_DEBUG: Set to "true" to enable debug logging
15
+ *
16
+ * Usage:
17
+ * ATTROVE_API_KEY=sk_... ATTROVE_USER_ID=... npx @attrove/mcp
18
+ *
19
+ * Claude Desktop configuration:
20
+ * {
21
+ * "mcpServers": {
22
+ * "attrove": {
23
+ * "command": "npx",
24
+ * "args": ["@attrove/mcp"],
25
+ * "env": {
26
+ * "ATTROVE_API_KEY": "sk_...",
27
+ * "ATTROVE_USER_ID": "..."
28
+ * }
29
+ * }
30
+ * }
31
+ * }
32
+ */
33
+
34
+ const isDebug = process.env.ATTROVE_DEBUG === 'true' || process.env.DEBUG === 'true';
35
+
36
+ async function main() {
37
+ try {
38
+ // Import the server module
39
+ const { startServer, getConfigFromEnv } = await import('../esm/index.js');
40
+
41
+ // Get configuration from environment
42
+ const config = getConfigFromEnv();
43
+
44
+ // Start the server
45
+ await startServer(config);
46
+ } catch (error) {
47
+ // Always show the error message
48
+ console.error('Failed to start Attrove MCP server:', error.message);
49
+
50
+ // Show stack trace in debug mode for easier troubleshooting
51
+ if (isDebug && error.stack) {
52
+ console.error('\nStack trace:');
53
+ console.error(error.stack);
54
+ }
55
+
56
+ // Show additional context for common errors
57
+ if (error.message.includes('ATTROVE_API_KEY')) {
58
+ console.error('\nHint: Set the ATTROVE_API_KEY environment variable to your API key (sk_...)');
59
+ } else if (error.message.includes('ATTROVE_USER_ID')) {
60
+ console.error('\nHint: Set the ATTROVE_USER_ID environment variable to the user ID (UUID)');
61
+ } else if (error.message.includes('Cannot find module')) {
62
+ console.error('\nHint: Try running "npm install" or "npm rebuild" to reinstall dependencies');
63
+ }
64
+
65
+ process.exit(1);
66
+ }
67
+ }
68
+
69
+ main();
package/package.json CHANGED
@@ -1 +1,68 @@
1
- {"name":"@attrove/mcp","version":"0.0.1"}
1
+ {
2
+ "name": "@attrove/mcp",
3
+ "version": "0.1.0",
4
+ "description": "MCP server for Attrove - AI-powered context retrieval for Claude and Cursor",
5
+ "main": "./cjs/index.js",
6
+ "module": "./esm/index.js",
7
+ "types": "./types/src/index.d.ts",
8
+ "bin": {
9
+ "attrove-mcp": "./bin/attrove-mcp.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "import": {
14
+ "types": "./types/src/index.d.ts",
15
+ "default": "./esm/index.js"
16
+ },
17
+ "require": {
18
+ "types": "./types/src/index.d.ts",
19
+ "default": "./cjs/index.js"
20
+ }
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "bin",
26
+ "README.md"
27
+ ],
28
+ "sideEffects": false,
29
+ "keywords": [
30
+ "attrove",
31
+ "mcp",
32
+ "model-context-protocol",
33
+ "claude",
34
+ "cursor",
35
+ "ai",
36
+ "rag",
37
+ "llm"
38
+ ],
39
+ "author": "Attrove <support@attrove.com>",
40
+ "license": "MIT",
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "https://github.com/attrove/attrove-js.git",
44
+ "directory": "packages/mcp"
45
+ },
46
+ "homepage": "https://attrove.com/docs/mcp",
47
+ "bugs": {
48
+ "url": "https://github.com/attrove/attrove-js/issues"
49
+ },
50
+ "engines": {
51
+ "node": ">=18.0.0"
52
+ },
53
+ "scripts": {
54
+ "build": "nx build mcp",
55
+ "test": "nx test mcp"
56
+ },
57
+ "dependencies": {
58
+ "@modelcontextprotocol/sdk": "^1.0.0",
59
+ "@attrove/sdk": "0.1.0"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "^20.0.0",
63
+ "typescript": "~5.7.0"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ }
68
+ }