Content
# MCP Threads API Server
This is a server implementation utilizing the Threads API.
## Features
- Read/write posts using the Threads API
- Access token-based authentication
- Support for text, image, and video posts
- Type safety using TypeScript
## Installation
```bash
npm install
```
## Environment Variable Configuration
Create a `.env` file and set the following content:
```
# Server configuration
PORT=3000
NODE_ENV=development
# Threads API configuration
THREADS_ACCESS_TOKEN=your_access_token_here
```
## Running the Server
Run in development mode:
```bash
npm run dev
```
Run after building:
```bash
npm run build
npm start
```
## API Endpoints
### Profile
- `GET /api/profile/me` - Get my profile information
- `GET /api/profile/:username` - Search for user profile
### Thread
- `GET /api/thread/:threadId` - Get thread information
- `POST /api/thread/create` - Create a thread container
- `POST /api/thread/publish` - Publish a thread
## Testing
### Run All Tests
```bash
npm test
```
### Check Test Coverage
```bash
npm run test:coverage
```
### Automatically Run Tests During Development
```bash
npm run test:watch
```
## Test Configuration
- Unit tests: Located in the `src/__tests__` directory
- Integration tests: Located in the `src/__tests__/integration` directory
## Project Structure
```
src/
├── __tests__/ # Test code
├── bin/ # CLI tools
├── config/ # Configuration related code
├── controllers/ # HTTP request handlers
├── middlewares/ # Middleware (authentication, etc.)
├── routes/ # API routes
├── services/ # Business logic
├── types/ # Type definitions
└── utils/ # Utility functions
```
## Local Testing
To test the project locally:
1. Clone the repository:
```bash
git clone https://github.com/yourusername/mcp-threads-server.git
cd mcp-threads-server
```
2. Install dependencies:
```bash
npm install
```
3. Create a `.env` file and enter your credentials:
```bash
cp .env.example .env
# Edit the .env file to add Access Token
```
4. Run the server:
```bash
npm start
```
## Claude Desktop Configuration
Add the following to the `claude_desktop_config.json` file:
```json
{
"mcpServers": {
"threads": {
"command": "npx",
"args": [
"-y",
"@makerkim/mcp-threads-server",
"--token",
"your_access_token"
]
}
}
}
```
## References
- [Threads API Official Documentation](https://developers.facebook.com/docs/threads/)
- [Threads API Postman Collection](https://www.postman.com/meta/threads/overview)
## License
ISC
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
airbyte-agent-connectors
Airbyte Agent Connectors for seamless data integration.
airbyte-ai-connectors
Airbyte AI Connectors for seamless data integration and publishing.
alibabacloud-ack-mcp-server
Alibaba Cloud ACK MCP Server integrates resource management and...