AgentStack
MCP verified MIT Self-run

Tiktok Api Docs Mcp

mcp-newform-ai-tiktok-api-docs-mcp · by Newform-AI

MCP server for searching and retrieving TikTok API documentation using OpenAI vector store

No reviews yet
0 installs
1 views
0.0% view→install

Install

$ agentstack add mcp-newform-ai-tiktok-api-docs-mcp

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Tiktok Api Docs Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

TikTok API Docs MCP Server

An MCP (Model Context Protocol) server that provides semantic search and retrieval for TikTok API documentation using OpenAI's vector store. Compatible with ChatGPT connectors, deep research, and API integrations.

🎯 Purpose

This server enables AI models to search and retrieve TikTok API documentation through the Model Context Protocol. It's designed to work with:

  • ChatGPT Connectors for enhanced chat capabilities
  • Deep Research models (o4-mini-deep-research)
  • Any MCP-compatible client

✨ Features

  • Semantic Search: Search TikTok API documentation using natural language queries
  • Document Retrieval: Fetch full documentation content by ID
  • Vector Store Integration: Powered by OpenAI's vector store for accurate semantic search
  • Dual Transport Support: Run via stdio (local) or SSE/HTTP (remote)
  • ChatGPT Compatible: Implements the required search and fetch tools for ChatGPT integration

📋 Prerequisites

  1. OpenAI API Key: Required for vector store operations
  2. Bun Runtime: This project uses Bun for optimal performance
  3. TikTok Documentation: Automatically downloaded during setup

🚀 Quick Start

1. Install Dependencies

bun install

2. Set up OpenAI API Key

export OPENAI_API_KEY=sk-your-api-key-here

3. Initialize Vector Store with TikTok Docs

# This downloads TikTok docs and uploads them to OpenAI vector store
bun run src/scripts/tikTokDocsToVectorStore.ts

This will:

  • Download all TikTok API documentation (~200+ files)
  • Create an OpenAI vector store named "TikTok API Documentation"
  • Upload and index all documentation
  • Save configuration to tiktok-docs/vector-store-config.json

4. Start the MCP Server

For HTTP/SSE mode (ChatGPT and remote access):

bun run start:http

For stdio mode (local MCP clients):

bun run start

🛠️ Available Tools

search

Search TikTok API documentation for relevant information.

Parameters:

  • query (string): Search query

Returns:

{
  "results": [
    {
      "id": "file_123",
      "title": "Campaign Management",
      "text": "Relevant snippet...",
      "url": "https://platform.tiktok.com/docs/campaign-management"
    }
  ]
}

fetch

Retrieve full content of a documentation file.

Parameters:

  • id (string): File ID from search results

Returns:

{
  "id": "file_123",
  "title": "Campaign Management",
  "text": "Full document content...",
  "url": "https://platform.tiktok.com/docs/campaign-management",
  "metadata": {...}
}

vector_store_status

Check vector store configuration status.

Returns:

{
  "configured": true,
  "store_id": "vs_abc123",
  "message": "Vector store is configured and ready"
}

🔗 Integration with ChatGPT

Via ChatGPT Connectors

  1. Go to ChatGPT Settings → Connectors
  2. Add new MCP server:
  • URL: https://your-server-url/sse/
  • Tools: search, fetch
  • Approval: Set to "never" for deep research

Via OpenAI API

curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "o4-mini-deep-research",
    "input": [{
      "role": "user",
      "content": [{
        "type": "input_text",
        "text": "How do I create a TikTok ad campaign?"
      }]
    }],
    "tools": [{
      "type": "mcp",
      "server_label": "tiktok-docs",
      "server_url": "http://localhost:3001/sse/",
      "allowed_tools": ["search", "fetch"],
      "require_approval": "never"
    }]
  }'

📁 Project Structure

├── src/
│   ├── core/
│   │   ├── services/
│   │   │   ├── vector-store-service.ts  # OpenAI vector store operations
│   │   │   └── greeting-service.ts      # Legacy example service
│   │   ├── tools.ts                     # MCP tool definitions
│   │   ├── resources.ts                 # MCP resources
│   │   └── prompts.ts                   # MCP prompts
│   ├── scripts/
│   │   ├── tikTokDocsToVectorStore.ts   # Setup script for vector store
│   │   └── getTikTokDocsMd.ts          # TikTok docs downloader
│   ├── server/
│   │   ├── http-server.ts              # SSE/HTTP server
│   │   └── server.ts                    # Core server setup
│   └── index.ts                         # stdio server entry
├── tiktok-docs/                         # Downloaded documentation (gitignored)
│   └── vector-store-config.json        # Vector store configuration
├── MCP_SERVER_README.md                # Detailed MCP server documentation
└── README.md                            # This file

🧪 Testing

Test the Server

# Run the test script
node test-mcp-server.js

Manual Testing

Search for documentation:

curl -X POST http://localhost:3001/sse/ \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "search",
      "arguments": {"query": "campaign creation"}
    }
  }'

📝 Scripts

Vector Store Management

# Download docs and sync to vector store
bun run src/scripts/tikTokDocsToVectorStore.ts

# Search the vector store
bun run src/scripts/tikTokDocsToVectorStore.ts --search "your query"

Server Commands

# Production
bun run start          # stdio mode
bun run start:http     # HTTP/SSE mode

# Development (with auto-reload)
bun run dev           # stdio mode
bun run dev:http      # HTTP/SSE mode

# Build
bun run build         # Build stdio server
bun run build:http    # Build HTTP server

🔧 Configuration

Environment Variables

OPENAI_API_KEY=sk-...  # Required: OpenAI API key
PORT=3001              # HTTP server port (default: 3001)

Vector Store Configuration

After running the setup script, configuration is saved to:

{
  "vectorStoreId": "vs_abc123",
  "vectorStoreName": "TikTok API Documentation",
  "lastSync": "2024-01-01T00:00:00Z",
  "filesCount": 200
}

🚢 Deployment

Using PM2

# Install PM2
npm install -g pm2

# Start the server
pm2 start bun --name "tiktok-mcp" -- run start:http

# Save PM2 configuration
pm2 save
pm2 startup

Using Docker

FROM oven/bun:latest
WORKDIR /app
COPY package.json bun.lockb ./
RUN bun install
COPY . .
ENV PORT=3001
EXPOSE 3001
CMD ["bun", "run", "start:http"]

🔒 Security Considerations

  • API Keys: Never commit API keys to version control
  • HTTPS: Use HTTPS in production environments
  • Authentication: Implement authentication for public deployments
  • Rate Limiting: Consider implementing rate limiting for API endpoints
  • CORS: Configure appropriate CORS headers for your use case

📚 Documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

🙏 Acknowledgments

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.