twitterapi-io-mcp 1.0.9
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/LICENSE +21 -0
- package/README.md +198 -0
- package/data/docs.json +6240 -0
- package/index.js +2468 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Doruk Ardahan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# twitterapi-io-mcp
|
|
2
|
+
|
|
3
|
+
**npm packages**
|
|
4
|
+
- `twitterapi-io-mcp` (recommended)
|
|
5
|
+
- `twitterapi-docs-mcp` (legacy compatibility wrapper)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/twitterapi-io-mcp)
|
|
8
|
+
[](https://www.npmjs.com/package/twitterapi-io-mcp)
|
|
9
|
+
[](https://www.npmjs.com/package/twitterapi-docs-mcp)
|
|
10
|
+
[](https://registry.modelcontextprotocol.io)
|
|
11
|
+
[](https://opensource.org/licenses/MIT)
|
|
12
|
+
[](https://nodejs.org/)
|
|
13
|
+
|
|
14
|
+
MCP (Model Context Protocol) server providing **offline access** to [TwitterAPI.io](https://twitterapi.io) documentation for Claude and other AI assistants.
|
|
15
|
+
|
|
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.
|
|
17
|
+
|
|
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
|
|
24
|
+
|
|
25
|
+
## Why I Built This
|
|
26
|
+
|
|
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.
|
|
28
|
+
|
|
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.
|
|
30
|
+
|
|
31
|
+
I'm sharing this with the community because if it helped me, it might help you too. 🚀
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **52 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
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
### Claude Desktop
|
|
45
|
+
|
|
46
|
+
Add to your Claude Desktop configuration file:
|
|
47
|
+
|
|
48
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
49
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"twitterapi-io": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["-y", "twitterapi-io-mcp"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Claude Code
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Add globally (all projects)
|
|
66
|
+
claude mcp add --scope user twitterapi-io -- npx -y twitterapi-io-mcp
|
|
67
|
+
|
|
68
|
+
# Or add to current project only
|
|
69
|
+
claude mcp add twitterapi-io -- npx -y twitterapi-io-mcp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Verify installation:
|
|
73
|
+
```bash
|
|
74
|
+
claude mcp list
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Available Tools
|
|
78
|
+
|
|
79
|
+
| Tool | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| `search_twitterapi_docs` | Full-text search across all docs (endpoints, guides, blogs) |
|
|
82
|
+
| `get_twitterapi_endpoint` | Get detailed info for a specific API endpoint |
|
|
83
|
+
| `list_twitterapi_endpoints` | List all endpoints with optional category filter |
|
|
84
|
+
| `get_twitterapi_guide` | Get a page by key (guides + other site/docs pages) |
|
|
85
|
+
| `get_twitterapi_url` | Fetch by URL, bare path (`pricing`), or page key (`qps_limits`) (snapshot, optional live fetch) |
|
|
86
|
+
| `get_twitterapi_pricing` | Quick access to pricing information |
|
|
87
|
+
| `get_twitterapi_auth` | Quick access to authentication guide |
|
|
88
|
+
|
|
89
|
+
## Available Resources
|
|
90
|
+
|
|
91
|
+
| Resource URI | Description |
|
|
92
|
+
|--------------|-------------|
|
|
93
|
+
| `twitterapi://guides/pricing` | Pricing guide |
|
|
94
|
+
| `twitterapi://guides/qps-limits` | QPS limits and rate limiting |
|
|
95
|
+
| `twitterapi://guides/filter-rules` | Tweet filter rules syntax |
|
|
96
|
+
| `twitterapi://guides/changelog` | API changelog |
|
|
97
|
+
| `twitterapi://guides/introduction` | Introduction to TwitterAPI.io |
|
|
98
|
+
| `twitterapi://guides/authentication` | Authentication guide |
|
|
99
|
+
| `twitterapi://endpoints/list` | Full endpoint listing |
|
|
100
|
+
| `twitterapi://status/freshness` | Data freshness status |
|
|
101
|
+
|
|
102
|
+
## Usage Examples
|
|
103
|
+
|
|
104
|
+
Once installed, you can ask Claude questions like:
|
|
105
|
+
|
|
106
|
+
- "What are the QPS limits for TwitterAPI.io?"
|
|
107
|
+
- "Show me the advanced search endpoint"
|
|
108
|
+
- "How do webhook filter rules work?"
|
|
109
|
+
- "How do I get user followers?"
|
|
110
|
+
- "What's the pricing structure?"
|
|
111
|
+
- "How do I authenticate with the API?"
|
|
112
|
+
|
|
113
|
+
## API Endpoint Categories
|
|
114
|
+
|
|
115
|
+
| Category | Count | Examples |
|
|
116
|
+
|----------|-------|----------|
|
|
117
|
+
| **User** | 9 | get_user_by_username, get_user_followers, get_user_followings |
|
|
118
|
+
| **Tweet** | 7 | tweet_advanced_search, get_tweet_reply, get_tweet_quote |
|
|
119
|
+
| **Community** | 5 | get_community_by_id, get_community_members |
|
|
120
|
+
| **Webhook** | 4 | add_webhook_rule, get_webhook_rules |
|
|
121
|
+
| **Stream** | 2 | add_user_to_monitor_tweet |
|
|
122
|
+
| **Action** | 16 | create_tweet, like_tweet, follow_user_v2 |
|
|
123
|
+
| **DM** | 2 | send_dm_v2, get_dm_history_by_user_id |
|
|
124
|
+
| **List** | 2 | get_list_followers, get_list_members |
|
|
125
|
+
| **Trend** | 1 | get_trends |
|
|
126
|
+
|
|
127
|
+
## How It Works
|
|
128
|
+
|
|
129
|
+
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:
|
|
130
|
+
|
|
131
|
+
1. The assistant calls one of the available tools
|
|
132
|
+
2. The server searches/retrieves from the local documentation cache
|
|
133
|
+
3. Results are returned instantly without network latency
|
|
134
|
+
|
|
135
|
+
The documentation includes:
|
|
136
|
+
- Complete API reference with request/response examples
|
|
137
|
+
- Authentication guides
|
|
138
|
+
- Rate limiting information
|
|
139
|
+
- Pricing details
|
|
140
|
+
- Best practices
|
|
141
|
+
|
|
142
|
+
## Updating Documentation
|
|
143
|
+
|
|
144
|
+
If TwitterAPI.io updates their documentation, clone the repo and run the scraper:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
git clone https://github.com/dorukardahan/twitterapi-io-mcp.git
|
|
148
|
+
cd twitterapi-io-mcp
|
|
149
|
+
npm install
|
|
150
|
+
node scrape-all.cjs
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Note: The scraper is included in the repository but not in the npm package.
|
|
154
|
+
|
|
155
|
+
## Development
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Clone repository
|
|
159
|
+
git clone https://github.com/dorukardahan/twitterapi-io-mcp.git
|
|
160
|
+
cd twitterapi-io-mcp
|
|
161
|
+
|
|
162
|
+
# Install dependencies
|
|
163
|
+
npm install
|
|
164
|
+
|
|
165
|
+
# Run tests
|
|
166
|
+
npm test
|
|
167
|
+
|
|
168
|
+
# Start server locally
|
|
169
|
+
npm start
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Technical Details
|
|
173
|
+
|
|
174
|
+
- **Runtime**: Node.js 18.18.0+
|
|
175
|
+
- **Module System**: ES Modules (no build step)
|
|
176
|
+
- **Protocol**: MCP (Model Context Protocol) via stdio
|
|
177
|
+
- **Caching**: Hybrid (memory + disk) with 24-hour TTL
|
|
178
|
+
- **Search**: Advanced tokenization with n-gram fuzzy matching
|
|
179
|
+
|
|
180
|
+
## Contributing
|
|
181
|
+
|
|
182
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
183
|
+
|
|
184
|
+
1. Fork the repository
|
|
185
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
186
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
187
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
188
|
+
5. Open a Pull Request
|
|
189
|
+
|
|
190
|
+
## License
|
|
191
|
+
|
|
192
|
+
[MIT](LICENSE) - see LICENSE file for details.
|
|
193
|
+
|
|
194
|
+
## Acknowledgments
|
|
195
|
+
|
|
196
|
+
- [TwitterAPI.io](https://twitterapi.io) for providing excellent Twitter/X API access
|
|
197
|
+
- [Anthropic](https://anthropic.com) for the Model Context Protocol
|
|
198
|
+
- [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) for the server framework
|