twitterapi-io-mcp 1.0.15 → 1.0.16

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 +132 -214
  2. package/index.js +1 -1
  3. package/package.json +7 -2
package/README.md CHANGED
@@ -1,60 +1,77 @@
1
1
  # twitterapi-io-mcp
2
2
 
3
- **npm packages**
4
- - `twitterapi-io-mcp` (recommended, canonical)
5
- - `twitterapi-docs-mcp` (deprecated compatibility wrapper → delegates to `twitterapi-io-mcp`)
3
+ > **TL;DR**: Offline TwitterAPI.io documentation for Claude and AI assistants via MCP. No API key needed.
4
+
5
+ ```bash
6
+ # Quick Install (Claude Code)
7
+ claude mcp add twitterapi-io -- npx -y twitterapi-io-mcp
8
+ ```
6
9
 
7
10
  [![npm version](https://img.shields.io/npm/v/twitterapi-io-mcp.svg)](https://www.npmjs.com/package/twitterapi-io-mcp)
8
11
  [![npm downloads](https://img.shields.io/npm/dm/twitterapi-io-mcp.svg)](https://www.npmjs.com/package/twitterapi-io-mcp)
9
- [![npm version (legacy)](https://img.shields.io/npm/v/twitterapi-docs-mcp.svg)](https://www.npmjs.com/package/twitterapi-docs-mcp)
10
12
  [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue?logo=anthropic)](https://registry.modelcontextprotocol.io)
11
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
14
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.18.0-brightgreen.svg)](https://nodejs.org/)
13
15
 
14
- MCP (Model Context Protocol) server providing **offline access** to [TwitterAPI.io](https://twitterapi.io) documentation for Claude and other AI assistants.
16
+ ---
15
17
 
16
- > **Disclaimer**: This is an unofficial community project. Not affiliated with, endorsed by, or sponsored by TwitterAPI.io. TwitterAPI.io is a trademark of its respective owner.
18
+ ## What is this?
17
19
 
18
- **Links**
19
- - GitHub: https://github.com/dorukardahan/twitterapi-io-mcp
20
- - npm (recommended): https://www.npmjs.com/package/twitterapi-io-mcp
21
- - npm (legacy): https://www.npmjs.com/package/twitterapi-docs-mcp
22
- - Context7 (canonical): https://context7.com/dorukardahan/twitterapi-io-mcp
23
- - Context7 (legacy slugs): https://context7.com/dorukardahan/twitterapi-docs-mcp, https://context7.com/dorukardahan/twitterapi.io-mcp
20
+ An MCP (Model Context Protocol) server that gives Claude and other AI assistants **instant, offline access** to [TwitterAPI.io](https://twitterapi.io) documentation.
24
21
 
25
- ## Why I Built This
22
+ **What's included:**
23
+ - **59 API endpoints** with full documentation
24
+ - **19 guide pages** (pricing, authentication, rate limits, etc.)
25
+ - **21 blog posts** with tutorials and guides
26
+
27
+ > **Disclaimer**: Unofficial community project. Not affiliated with TwitterAPI.io.
28
+
29
+ ---
26
30
 
27
- I'm an independent developer who uses [TwitterAPI.io](https://twitterapi.io) for my projects. I found myself constantly switching between my code editor and the documentation website, searching for endpoint details, checking rate limits, and looking up authentication requirements.
31
+ ## For AI Assistants
28
32
 
29
- So I built this MCP server to have **instant access to the entire documentation** right inside Claude. No more tab-switching, no more searching — just ask Claude and get the answer.
33
+ If you're an AI assistant using this MCP server, here's how to help users:
30
34
 
31
- I'm sharing this with the community because if it helped me, it might help you too. 🚀
35
+ | User wants... | Use this tool | Example |
36
+ |---------------|---------------|---------|
37
+ | Find an endpoint | `search_twitterapi_docs` | `query: "advanced search"` |
38
+ | Endpoint details | `get_twitterapi_endpoint` | `endpoint_name: "tweet_advanced_search"` |
39
+ | List all endpoints | `list_twitterapi_endpoints` | `category: "user"` (optional) |
40
+ | Pricing info | `get_twitterapi_pricing` | - |
41
+ | Auth guide | `get_twitterapi_auth` | - |
42
+ | Any guide/page | `get_twitterapi_guide` | `guide_name: "qps_limits"` |
43
+ | Fetch by URL | `get_twitterapi_url` | `url: "pricing"` |
32
44
 
33
- ## Features
45
+ **Tips:**
46
+ - Search is fuzzy/typo-tolerant: `"twet object"` still works
47
+ - Use `max_results: 5` for focused results
48
+ - Check `deprecation_notice` field for legacy endpoints
34
49
 
35
- - **54 API endpoints** documented
36
- - **Site + docs pages** via sitemap + internal link crawl (pricing, QPS limits, privacy, contact, terms, acceptable use, dashboard, etc.)
37
- - **Blog posts** via blog index crawl (and internal discovery)
38
- - **Offline-first** - Works without network access
39
- - **Fast search** with fuzzy matching and camelCase support
40
- - **Hybrid caching** for optimal performance
50
+ ---
41
51
 
42
52
  ## Installation
43
53
 
44
- **Prerequisites**
45
- - Node.js `>=18.18.0` (required to run the MCP server)
46
- - Claude Code users: the `claude` CLI installed (for `claude mcp add`)
54
+ **Prerequisites:** Node.js `>=18.18.0`
47
55
 
48
- Note: This MCP server serves an **offline docs snapshot**. You do **not** need a TwitterAPI.io key just to use the docs tools.
56
+ ### Claude Code (Recommended)
49
57
 
50
- ### Claude Desktop
58
+ ```bash
59
+ # Add globally (all projects)
60
+ claude mcp add --scope user twitterapi-io -- npx -y twitterapi-io-mcp
51
61
 
52
- Requires Node.js `>=18.18.0` (because this runs via `npx`).
62
+ # Or project-only
63
+ claude mcp add twitterapi-io -- npx -y twitterapi-io-mcp
53
64
 
54
- Add to your Claude Desktop configuration file:
65
+ # Verify
66
+ claude mcp list
67
+ ```
68
+
69
+ ### Claude Desktop
55
70
 
56
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
57
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
71
+ Add to your config file:
72
+
73
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
74
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
58
75
 
59
76
  ```json
60
77
  {
@@ -67,237 +84,138 @@ Add to your Claude Desktop configuration file:
67
84
  }
68
85
  ```
69
86
 
70
- ### Claude Code
71
-
72
- Requires Node.js `>=18.18.0` (because this runs via `npx`).
73
-
74
- ```bash
75
- # Add globally (all projects)
76
- claude mcp add --scope user twitterapi-io -- npx -y twitterapi-io-mcp
77
-
78
- # Or add to current project only
79
- claude mcp add twitterapi-io -- npx -y twitterapi-io-mcp
80
-
81
- # Legacy name (still works, but deprecated)
82
- claude mcp add --scope user twitterapi-docs -- npx -y twitterapi-docs-mcp
83
- ```
87
+ ### Other MCP Clients
84
88
 
85
- Verify installation:
86
89
  ```bash
87
- claude mcp list
90
+ npx -y twitterapi-io-mcp
88
91
  ```
89
92
 
90
- Troubleshooting:
91
- - `claude: command not found` → install Claude Code / the `claude` CLI first
92
- - `npx` fails or shows syntax errors → upgrade Node.js to `>=18.18.0`
93
- - Corporate networks → ensure npm can reach the registry (or configure your proxy/registry)
94
- - Quick preflight: `node -v` and `claude --version` should both work before running `claude mcp add`
95
-
96
- ## Optional Configuration
97
-
98
- - `TWITTERAPI_MCP_DISK_CACHE=0` disables disk cache across sessions (default: on). TTL cleanup runs hourly.
93
+ ---
99
94
 
100
95
  ## Available Tools
101
96
 
102
97
  | Tool | Description |
103
98
  |------|-------------|
104
- | `search_twitterapi_docs` | Full-text search across all docs (endpoints, guides, blogs) |
105
- | `get_twitterapi_endpoint` | Get detailed info for a specific API endpoint |
106
- | `list_twitterapi_endpoints` | List all endpoints with optional category filter |
107
- | `get_twitterapi_guide` | Get a page by key (guides + other site/docs pages) |
108
- | `get_twitterapi_url` | Fetch by URL, bare path (`pricing`), or page key (`qps_limits`) (snapshot, optional live fetch) |
109
- | `get_twitterapi_pricing` | Quick access to pricing information |
110
- | `get_twitterapi_auth` | Quick access to authentication guide |
111
-
112
- ## Available Resources
113
-
114
- Note: resources are optional. The canonical guide fetch is `get_twitterapi_guide` (e.g., `guide_name: "changelog"`).
115
-
116
- | Resource URI | Description |
117
- |--------------|-------------|
118
- | `twitterapi://guides/pricing` | Pricing guide |
119
- | `twitterapi://guides/qps-limits` | QPS limits and rate limiting |
120
- | `twitterapi://guides/filter-rules` | Tweet filter rules syntax |
121
- | `twitterapi://guides/introduction` | Introduction to TwitterAPI.io |
122
- | `twitterapi://guides/authentication` | Authentication guide |
123
- | `twitterapi://endpoints/list` | Full endpoint listing |
124
- | `twitterapi://status/freshness` | Data freshness status |
125
-
126
- ## MCP Tool Recipes
127
-
128
- If you’re evaluating this MCP via Context7 or want copy/pasteable “tool chaining” patterns, see `CONTEXT7.md`.
129
-
130
- Focused, single-purpose recipes are in `recipes/` (e.g. `recipes/01-auth-summary.md`, `recipes/07-rate-limits.md`).
131
-
132
- Common workflows:
133
- - **Rate limits**: `search_twitterapi_docs` (`"rate limit qps"`) → `get_twitterapi_guide` (`"qps_limits"`)
134
- - **Typos are OK**: `search_twitterapi_docs` is fuzzy/typo-tolerant (e.g., `"twet object"`)
135
- - **Tweets Lookup**: `get_twitterapi_endpoint` (`"get_tweet_by_ids"`)
136
-
137
- ## Context7 Quick Recipes (copy/paste)
138
-
139
- ### Search → refine → endpoint details (Q2)
140
-
141
- ```json
142
- { "tool": "search_twitterapi_docs", "arguments": { "query": "advanced search", "max_results": 10 } }
143
- ```
144
-
145
- Filter to `type: "endpoint"` results. If none, retry with a narrower query like `"advanced search endpoint"`.
146
- Then fetch details using the returned `name`:
147
-
148
- ```json
149
- { "tool": "get_twitterapi_endpoint", "arguments": { "endpoint_name": "tweet_advanced_search" } }
150
- ```
151
-
152
- Ambiguity handling (if multiple endpoints are close in score):
153
-
154
- ```json
155
- { "tool": "search_twitterapi_docs", "arguments": { "query": "advanced search GET /twitter/tweet/advanced_search", "max_results": 10 } }
156
- ```
157
-
158
- Then pick the top `type: "endpoint"` result and call `get_twitterapi_endpoint` with its `name`.
99
+ | `search_twitterapi_docs` | Full-text search across all docs (fuzzy matching) |
100
+ | `get_twitterapi_endpoint` | Get detailed endpoint documentation |
101
+ | `list_twitterapi_endpoints` | List endpoints by category |
102
+ | `get_twitterapi_guide` | Get guide pages (pricing, auth, limits, etc.) |
103
+ | `get_twitterapi_url` | Fetch content by URL or page key |
104
+ | `get_twitterapi_pricing` | Quick pricing information |
105
+ | `get_twitterapi_auth` | Quick authentication guide |
159
106
 
160
- Routing tips (dynamic refinement):
161
- - If a result includes `next`, you can directly call `next.tool` with `next.arguments`.
162
- - If you get only `page`/`blog` results, route to `get_twitterapi_guide` or `get_twitterapi_url` instead of `get_twitterapi_endpoint`.
107
+ ---
163
108
 
164
- ### Changelogs via `get_twitterapi_guide` (Q7)
109
+ ## API Endpoint Categories
165
110
 
166
- ```json
167
- { "tool": "get_twitterapi_guide", "arguments": { "guide_name": "changelog" } }
168
- ```
111
+ | Category | Count | Examples |
112
+ |----------|-------|----------|
113
+ | **User** | 12 | get_user_by_username, get_user_followers, batch_get_user_by_userids |
114
+ | **Tweet** | 8 | tweet_advanced_search, get_tweet_by_ids, get_tweet_replies_v2 |
115
+ | **Community** | 9 | create_community_v2, get_community_by_id, join_community_v2 |
116
+ | **Profile** | 3 | update_avatar_v2, update_banner_v2, update_profile_v2 |
117
+ | **Webhook** | 4 | add_webhook_rule, get_webhook_rules, update_webhook_rule |
118
+ | **Stream** | 3 | add_user_to_monitor_tweet, get_user_to_monitor_tweet |
119
+ | **Action** | 14 | create_tweet_v2, like_tweet_v2, retweet_tweet_v2, upload_media_v2 |
120
+ | **DM** | 2 | send_dm_v2, get_dm_history_by_user_id |
121
+ | **List** | 2 | get_list_followers, get_list_members |
122
+ | **Other** | 2 | get_trends, get_space_detail |
169
123
 
170
- Do **not** use `resources/read` for this question; the canonical tool is `get_twitterapi_guide`.
124
+ **Total: 59 endpoints**
171
125
 
172
- ### Tweets Lookup endpoint details (Q9)
126
+ ---
173
127
 
174
- Tweets Lookup maps to `endpoint_name: "get_tweet_by_ids"`.
128
+ ## Usage Examples
175
129
 
176
- ```json
177
- { "tool": "get_twitterapi_endpoint", "arguments": { "endpoint_name": "get_tweet_by_ids" } }
178
- ```
130
+ Ask Claude:
179
131
 
180
- ### Auth metadata (Q1)
132
+ - *"What are the rate limits for TwitterAPI.io?"*
133
+ - *"Show me the tweet advanced search endpoint"*
134
+ - *"How do I authenticate with the API?"*
135
+ - *"What's the pricing?"*
136
+ - *"How do webhook filter rules work?"*
181
137
 
182
- ```json
183
- { "tool": "get_twitterapi_auth", "arguments": {} }
184
- ```
138
+ ---
185
139
 
186
- Endpoint details also include an `auth` block (header/base URL). For per-endpoint extras, scan `description`/`parameters` for `login_cookie` or `proxy`.
140
+ ## Configuration
187
141
 
188
- ### Authentication page snapshot (Q6)
142
+ | Environment Variable | Default | Description |
143
+ |---------------------|---------|-------------|
144
+ | `TWITTERAPI_MCP_DISK_CACHE` | `1` (on) | Set to `0` to disable disk caching |
189
145
 
190
- ```json
191
- { "tool": "get_twitterapi_url", "arguments": { "url": "/documentation/authentication" } }
192
- ```
146
+ ---
193
147
 
194
- Fallback if the snapshot is missing:
148
+ ## How It Works
195
149
 
196
- ```json
197
- { "tool": "get_twitterapi_guide", "arguments": { "guide_name": "authentication" } }
198
150
  ```
199
-
200
- ### Pagination search (Q5)
201
-
202
- ```json
203
- { "tool": "search_twitterapi_docs", "arguments": { "query": "pagination cursor next_cursor", "max_results": 10 } }
151
+ ┌─────────────┐ MCP Protocol ┌──────────────────┐
152
+ │ Claude │ ◄──────────────────► twitterapi-io-mcp│
153
+ │ (or any AI) │ │ │
154
+ └─────────────┘ │ Local docs.json
155
+ │ (59 endpoints) │
156
+ └──────────────────┘
204
157
  ```
205
158
 
206
- ## Usage Examples
207
-
208
- Once installed, you can ask Claude questions like:
159
+ 1. AI assistant calls MCP tools (search, get endpoint, etc.)
160
+ 2. Server searches local documentation snapshot
161
+ 3. Results returned instantly (no network needed)
209
162
 
210
- - "What are the QPS limits for TwitterAPI.io?"
211
- - "Show me the advanced search endpoint"
212
- - "How do webhook filter rules work?"
213
- - "How do I get user followers?"
214
- - "What's the pricing structure?"
215
- - "How do I authenticate with the API?"
163
+ ---
216
164
 
217
- ## API Endpoint Categories
218
-
219
- | Category | Count | Examples |
220
- |----------|-------|----------|
221
- | **User** | 11 | get_user_by_username, get_user_followers, batch_get_user_by_userids |
222
- | **Tweet** | 7 | tweet_advanced_search, get_tweet_by_ids, get_tweet_quote |
223
- | **Community** | 9 | create_community_v2, get_community_by_id, join_community_v2 |
224
- | **Webhook** | 4 | add_webhook_rule, get_webhook_rules |
225
- | **Stream** | 2 | add_user_to_monitor_tweet, remove_user_to_monitor_tweet |
226
- | **Action** | 15 | create_tweet_v2, like_tweet_v2, upload_media_v2 |
227
- | **DM** | 2 | send_dm_v2, get_dm_history_by_user_id |
228
- | **List** | 2 | get_list_followers, get_list_members |
229
- | **Trend** | 1 | get_trends |
230
- | **Other** | 1 | get_space_detail |
231
-
232
- ## How It Works
233
-
234
- This MCP server bundles a snapshot of TwitterAPI.io documentation (scraped with permission patterns). When Claude or another MCP-compatible AI assistant needs information about TwitterAPI.io:
235
-
236
- 1. The assistant calls one of the available tools
237
- 2. The server searches/retrieves from the local documentation cache
238
- 3. Results are returned instantly without network latency
239
-
240
- The documentation includes:
241
- - Complete API reference with request/response examples
242
- - Authentication guides
243
- - Rate limiting information
244
- - Pricing details
245
- - Best practices
246
-
247
- ## Updating Documentation
248
-
249
- If TwitterAPI.io updates their documentation, clone the repo and run the scraper:
165
+ ## Development
250
166
 
251
167
  ```bash
252
168
  git clone https://github.com/dorukardahan/twitterapi-io-mcp.git
253
169
  cd twitterapi-io-mcp
254
170
  npm install
255
- node scrape-all.cjs
171
+ npm test # Run tests
172
+ npm start # Start server
173
+ npm run scrape # Update docs snapshot
256
174
  ```
257
175
 
258
- Note: The scraper is included in the repository but not in the npm package.
176
+ ---
259
177
 
260
- ## Development
178
+ ## Technical Details
261
179
 
262
- ```bash
263
- # Clone repository
264
- git clone https://github.com/dorukardahan/twitterapi-io-mcp.git
265
- cd twitterapi-io-mcp
180
+ | Property | Value |
181
+ |----------|-------|
182
+ | Runtime | Node.js 18.18.0+ |
183
+ | Module System | ES Modules (no build step) |
184
+ | Protocol | MCP via stdio |
185
+ | Caching | Hybrid (memory + disk), 24h TTL |
186
+ | Search | N-gram fuzzy matching |
266
187
 
267
- # Install dependencies
268
- npm install
188
+ ---
269
189
 
270
- # Run tests
271
- npm test
190
+ ## Links
272
191
 
273
- # Start server locally
274
- npm start
275
- ```
192
+ - **npm**: https://www.npmjs.com/package/twitterapi-io-mcp
193
+ - **GitHub**: https://github.com/dorukardahan/twitterapi-io-mcp
194
+ - **MCP Registry**: https://registry.modelcontextprotocol.io
195
+ - **TwitterAPI.io**: https://twitterapi.io
276
196
 
277
- ## Technical Details
197
+ ---
198
+
199
+ ## Why I Built This
200
+
201
+ I use [TwitterAPI.io](https://twitterapi.io) for my projects and got tired of switching between my editor and docs. Now I just ask Claude. If it helps me, maybe it helps you too.
278
202
 
279
- - **Runtime**: Node.js 18.18.0+
280
- - **Module System**: ES Modules (no build step)
281
- - **Protocol**: MCP (Model Context Protocol) via stdio
282
- - **Caching**: Hybrid (memory + disk) with 24-hour TTL
283
- - **Search**: Advanced tokenization with n-gram fuzzy matching
203
+ ---
284
204
 
285
205
  ## Contributing
286
206
 
287
- Contributions are welcome! Please feel free to submit a Pull Request.
207
+ PRs welcome! Fork branch commit PR.
288
208
 
289
- 1. Fork the repository
290
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
291
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
292
- 4. Push to the branch (`git push origin feature/amazing-feature`)
293
- 5. Open a Pull Request
209
+ ---
294
210
 
295
211
  ## License
296
212
 
297
- [MIT](LICENSE) - see LICENSE file for details.
213
+ [MIT](LICENSE)
214
+
215
+ ---
298
216
 
299
217
  ## Acknowledgments
300
218
 
301
- - [TwitterAPI.io](https://twitterapi.io) for providing excellent Twitter/X API access
302
- - [Anthropic](https://anthropic.com) for the Model Context Protocol
303
- - [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) for the server framework
219
+ - [TwitterAPI.io](https://twitterapi.io) for the API service
220
+ - [Anthropic](https://anthropic.com) for MCP
221
+ - [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk)
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * TwitterAPI.io Documentation MCP Server v1.0.15
3
+ * TwitterAPI.io Documentation MCP Server v1.0.16
4
4
  *
5
5
  * Production-ready MCP server with:
6
6
  * - Comprehensive error handling with ErrorType classification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twitterapi-io-mcp",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "mcpName": "io.github.dorukardahan/twitterapi-io-mcp",
5
5
  "description": "TwitterAPI.io MCP server providing offline access to docs (endpoints, pages, blogs) for Claude and other AI assistants",
6
6
  "main": "index.js",
@@ -21,15 +21,20 @@
21
21
  "model-context-protocol",
22
22
  "claude",
23
23
  "twitter",
24
+ "twitter-api",
25
+ "x-api",
24
26
  "twitterapi",
25
27
  "twitterapi.io",
26
28
  "twitterapi-io",
27
29
  "twitterapi-io-mcp",
28
30
  "api-documentation",
31
+ "api-reference",
29
32
  "ai-assistant",
30
33
  "llm",
31
34
  "anthropic",
32
- "offline-docs"
35
+ "offline-docs",
36
+ "claude-mcp",
37
+ "twitter-docs"
33
38
  ],
34
39
  "author": "Doruk Ardahan",
35
40
  "license": "MIT",