openai-vector-store-mcp
v1.2.0
Published
Universal OpenAI Vector Store MCP Server with stdio transport - 21 comprehensive tools including file management, enhanced Roo compatibility, and direct stdio performance
Maintainers
Readme
Universal OpenAI Vector Store MCP Server (NPM Package)
A Model Context Protocol (MCP) server that provides comprehensive OpenAI Vector Store operations and file upload capabilities through stdio transport. This is the recommended installation method for most users, offering direct compatibility with Claude Desktop, Roo, and other MCP clients without requiring proxy servers.
🆕 Phase 2 v1.2.0: Now includes complete file-to-vector-store workflow with 6 new file management tools, solving real-world scenarios like processing 470 PDF files directly from your local filesystem.
🌟 Part of the Universal MCP Server Ecosystem
This NPM package is one of three deployment options for the Universal OpenAI Vector Store MCP Server:
- 📦 NPM Package (This package) - Direct stdio transport, no proxy required
- ☁️ Cloudflare Workers - Zero-setup cloud deployment
- 🔧 Local Development - Full source code access and customization
Choose the option that best fits your needs. See the main repository for all options.
✨ Features
- 21 Comprehensive Tools: Complete OpenAI Vector Store API coverage + file upload capabilities
- 🆕 File Upload & Management: Direct file upload from local filesystem to OpenAI (Phase 2)
- Complete End-to-End Workflow: Upload files → Create vector stores → Add files → Query documents
- Direct Stdio Transport: No proxy servers required - fastest and most reliable
- Universal Compatibility: Works with Claude Desktop, Roo, and all MCP clients
- Large File Support: Multipart uploads for files up to 512MB
- TypeScript: Full type safety and modern development experience
- Zero Dependencies: Lightweight with minimal runtime footprint
- Easy Installation: Simple
npxusage or global installation - Comprehensive Testing: Built-in test suite for validation
- Environment Variable Support: Secure API key management
🛠️ Available Tools (21 Total)
Core Vector Store Operations
vector-store-create- Create a new vector store with optional expiration and metadatavector-store-list- List all vector stores with pagination and sortingvector-store-get- Get detailed information about a specific vector storevector-store-delete- Delete a vector store permanentlyvector-store-modify- Update vector store name, expiration, or metadata
🆕 File Upload & Management Operations (Phase 2)
file-upload- Upload local files directly to OpenAI (CRITICAL - enables end-to-end workflow)file-list- List all uploaded files with filtering and paginationfile-get- Get detailed information about specific filesfile-delete- Remove files from OpenAI storagefile-content- Download and retrieve file contentupload-create- Create multipart uploads for large files (>25MB)
Vector Store File Operations
vector-store-file-add- Add an existing file to a vector storevector-store-file-list- List all files in a vector store with filteringvector-store-file-get- Get details of a specific file in a vector storevector-store-file-content- Retrieve the content of a file in a vector storevector-store-file-update- Update file metadatavector-store-file-delete- Remove a file from a vector store
Batch Operations
vector-store-file-batch-create- Create a batch operation for multiple filesvector-store-file-batch-get- Get the status of a batch operationvector-store-file-batch-cancel- Cancel a running batch operationvector-store-file-batch-files- List files in a batch operation
Installation
Option 1: NPX (Recommended)
npx openai-vector-store-mcp@latestOption 2: Global Installation
npm install -g openai-vector-store-mcp@latest
openai-vector-store-mcpOption 3: Local Installation
npm install openai-vector-store-mcp@latest
npx openai-vector-store-mcp@latest💡 Why use @latest?
- Ensures you get the most recent bug fixes and improvements
- Bypasses NPM cache issues that can cause outdated versions
- Recommended for most reliable experience
Prerequisites
- Node.js: Version 18.0.0 or higher
- OpenAI API Key: Required for vector store operations (configured via MCP client)
Configuration
API Key Setup
Important: As of version 1.1.1, this package no longer requires environment variables to be set before startup. The API key is provided by your MCP client configuration and validated only when tools are called.
The server will start successfully without an API key and will only validate it when you actually use the vector store tools.
🔧 Client Integration
Claude Desktop Setup
Add the following configuration to your Claude Desktop settings:
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp@latest"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp@latest"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}Linux
Edit ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
}
}
}
}🤖 Roo Integration
Roo users get the best experience with this NPM package due to direct stdio transport. Add the following to your Roo configuration:
Roo Configuration
Edit your Roo configuration file (typically ~/.config/roo/config.json):
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp@latest"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key-here"
},
"alwaysAllow": [
"vector-store-create",
"vector-store-list",
"vector-store-get",
"vector-store-delete",
"vector-store-modify",
"vector-store-file-add",
"vector-store-file-list",
"vector-store-file-get",
"vector-store-file-content",
"vector-store-file-update",
"vector-store-file-delete",
"vector-store-file-batch-create",
"vector-store-file-batch-get",
"vector-store-file-batch-cancel",
"vector-store-file-batch-files"
]
}
}
}Why Roo Users Should Choose This Package
- No Proxy Required: Direct stdio communication is faster and more reliable
- Automatic Tool Approval: The
alwaysAllowconfiguration prevents constant permission prompts - Better Performance: No HTTP overhead or network latency
- Simpler Setup: No need to install or manage
mcp-proxy - Local Execution: Full control over the server environment
Roo-Specific Features
- Seamless Integration: Works out-of-the-box with Roo's MCP implementation
- Tool Auto-Approval: Pre-configure all 15 tools to avoid interruptions
- Environment Variables: Secure API key management through environment variables
- Debug Support: Easy debugging with
DEBUG=*environment variable
🖥️ Claude Code CLI Integration
Claude Code CLI users get excellent performance with this NPM package due to direct stdio transport. Add the MCP server using the command line interface:
Basic Setup
# Add the MCP server with local scope (default - available only in current project)
claude mcp add openai-vector-store -- npx openai-vector-store-mcp@latest --env OPENAI_API_KEY="your-openai-api-key-here"
# Add with project scope (shared with team via .mcp.json file)
claude mcp add --scope project openai-vector-store -- npx openai-vector-store-mcp@latest --env OPENAI_API_KEY="your-openai-api-key-here"
# Add with user scope (available across all your projects)
claude mcp add --scope user openai-vector-store -- npx openai-vector-store-mcp@latest --env OPENAI_API_KEY="your-openai-api-key-here"Scope Options
--scope local(default): Available only to you in the current project--scope project: Shared with everyone in the project via.mcp.jsonfile--scope user: Available to you across all projects
Managing MCP Servers
# List all configured servers
claude mcp list
# Get details for the server
claude mcp get openai-vector-store
# Remove the server
claude mcp remove openai-vector-store
# Check server status within Claude Code
/mcpProject-Level Configuration (.mcp.json)
When using --scope project, Claude Code creates a .mcp.json file in your project root:
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp@latest"],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}Environment Variable Expansion: Claude Code supports ${VAR} syntax for environment variables in .mcp.json files.
Why Claude Code CLI Users Should Choose This Package
- Direct Stdio Transport: Fastest possible communication with no HTTP overhead
- Command-Line Management: Easy server management with
claude mcpcommands - Flexible Scoping: Choose between local, project, or user-level configurations
- Environment Variable Support: Secure API key management through environment variables
- Team Collaboration: Share configurations via
.mcp.jsonfiles
📖 Usage Examples
🆕 Complete End-to-End Workflow (Phase 2 v1.2.0)
The Problem Solved: Previously, users had to manually upload files to OpenAI before using vector store tools. Now you can upload files directly from your local filesystem!
Basic Workflow
# 1. Upload a local file to OpenAI
"Upload the file ./documents/report.pdf to OpenAI"
# 2. Create a vector store for the uploaded files
"Create a vector store named 'Project Documents' that expires in 7 days"
# 3. Add the uploaded file to the vector store
"Add file file-abc123 to vector store vs_def456"
# 4. Now you can query the documents using OpenAI's Assistants API!Real-World Example: Processing 470 PDF Files
# Upload multiple files from a directory
"Upload all PDF files from ./research-papers/ to OpenAI"
# Create a dedicated vector store
"Create a vector store named 'Research Papers Collection' that expires in 30 days"
# Batch add all uploaded files to the vector store
"Create a batch to add all uploaded PDF files to the Research Papers Collection vector store"
# Monitor batch processing
"Get the status of the batch operation"
# Query your knowledge base
"Search for papers about machine learning in the Research Papers Collection"File Upload & Management
# Upload local files
"Upload the file ./data/research.txt to OpenAI"
"Upload all PDF files from ./documents/ to OpenAI"
# List uploaded files
"List all my uploaded files"
"List files uploaded in the last 7 days"
# Get file information
"Get details of file file-abc123"
# Download file content
"Get the content of file file-abc123"
# Delete files
"Delete file file-abc123 from OpenAI"Vector Store Management
# Create a new vector store
"Create a vector store called 'Documentation' that expires after 30 days"
# List vector stores
"Show me all my vector stores"
# Add files to vector stores
"Add file file-abc123 to the Documentation vector store"
# Manage files in vector stores
"List all files in the Documentation vector store"
"Get details about file file-abc123 in the Documentation vector store"Advanced Workflows
# Large file handling
"Create a multipart upload for the file ./large-dataset.zip"
"Upload the large file ./large-dataset.zip using multipart upload"
# Batch operations
"Create a batch to add files file-1, file-2, file-3 to vector store vs_def456"
"Get status of batch batch_abc123 in vector store vs_def456"Testing
Run the built-in test suite to verify the server is working correctly:
cd npm-package
npm testThe test suite validates:
- Server initialization
- Tool listing (all 15 tools)
- Protocol compliance
- Error handling
Development
Building from Source
- Clone the repository
- Install dependencies:
npm install - Build the TypeScript code:
npm run build - Run tests:
npm test
Project Structure
npm-package/
├── src/
│ ├── index.ts # Main server entry point
│ ├── mcp-handler.ts # MCP protocol handler
│ ├── openai-service.ts # OpenAI API service
│ └── types.ts # TypeScript type definitions
├── bin/
│ └── openai-vector-store-mcp.js # Executable script
├── dist/ # Compiled JavaScript output
├── test/
│ └── test-stdio.js # Test suite
└── package.jsonError Handling
The server includes comprehensive error handling:
- Invalid API Key: Clear error message with setup instructions
- Network Issues: Automatic retry logic for transient failures
- Invalid Parameters: Detailed validation error messages
- OpenAI API Errors: Proper error code mapping and user-friendly messages
🛠️ Troubleshooting
Common Issues
1. "OPENAI_API_KEY environment variable is required" (when calling tools)
Solution: This error now only appears when you try to use tools without configuring the API key in your MCP client. The server will start successfully without an API key.
Configure your API key in your MCP client configuration (see Client Integration section above).
2. "Failed to start server" or "Command not found"
Solutions:
# Verify Node.js version (requires 18+)
node --version
# Update Node.js if needed (using nvm)
nvm install 18
nvm use 18
# Clear npm cache and reinstall
npm cache clean --force
npm install -g openai-vector-store-mcp
# Test direct execution
npx openai-vector-store-mcp --version3. "Connection timeout" or "Network errors"
Solutions:
- Verify internet connectivity
- Check if OpenAI API is accessible:
curl https://api.openai.com/v1/models - Test your API key:
curl -H "Authorization: Bearer YOUR_KEY" https://api.openai.com/v1/models - Check firewall/proxy settings
4. Roo-Specific Issues
"Permission denied" or constant approval prompts:
{
"mcpServers": {
"openai-vector-store": {
"command": "npx",
"args": ["openai-vector-store-mcp"],
"env": {
"OPENAI_API_KEY": "your-key"
},
"alwaysAllow": [
"vector-store-create",
"vector-store-list",
"vector-store-get",
"vector-store-delete",
"vector-store-modify",
"vector-store-file-add",
"vector-store-file-list",
"vector-store-file-get",
"vector-store-file-content",
"vector-store-file-update",
"vector-store-file-delete",
"vector-store-file-batch-create",
"vector-store-file-batch-get",
"vector-store-file-batch-cancel",
"vector-store-file-batch-files"
]
}
}
}Tool names not recognized:
- Ensure exact tool names are used in
alwaysAllow - Restart Roo after configuration changes
- Check Roo logs for specific error messages
5. Claude Desktop Issues
"Server not responding" or "MCP server failed":
# Test the server independently (should start without API key)
npx openai-vector-store-mcp
# Check Claude Desktop logs (macOS)
tail -f ~/Library/Logs/Claude/claude_desktop.log
# Verify configuration file syntax
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python -m json.toolPlatform-Specific Setup
macOS
# Install Node.js via Homebrew
brew install node
# Verify installation
node --version
npm --version
# Install the package
npm install -g openai-vector-store-mcpWindows
# Download Node.js from nodejs.org
# Then install the package
npm install -g openai-vector-store-mcp
# Set environment variable permanently
setx OPENAI_API_KEY "your-key-here"Linux (Ubuntu/Debian)
# Install Node.js
sudo apt update
sudo apt install nodejs npm
# Verify version (upgrade if needed)
node --version
# Install the package
npm install -g openai-vector-store-mcpDebug Mode
Basic Debug
DEBUG=* npx openai-vector-store-mcpSpecific Debug Categories
# MCP protocol debugging
DEBUG=mcp:* npx openai-vector-store-mcp
# OpenAI API debugging
DEBUG=openai:* npx openai-vector-store-mcp
# All debugging
DEBUG=* npx openai-vector-store-mcp 2>&1 | tee debug.logNote: The server will start successfully without an API key. API key validation only occurs when tools are called.
Performance Optimization
For High-Volume Usage
- Use Global Installation:
npm install -gfor faster startup - Environment Variables: Set
OPENAI_API_KEYpermanently - Local Caching: Consider local Redis for caching (future feature)
- Rate Limiting: Be aware of OpenAI API rate limits
Memory and CPU
- Memory Usage: Typically <50MB RAM
- CPU Usage: Minimal when idle, scales with request volume
- Startup Time: <2 seconds for stdio transport
Migration from Other Versions
From Cloudflare Workers Version
- Remove mcp-proxy:
npm uninstall -g mcp-proxy - Update Configuration: Remove proxy URL, add environment variable
- Test Connection: Verify direct stdio communication works
From Previous NPM Versions
# Update to latest version
npm update -g openai-vector-store-mcp
# Clear any cached configurations
rm -rf ~/.npm/_cacacheGetting Additional Help
- Check Package Version:
npm list -g openai-vector-store-mcp - Verify OpenAI API Access: Test with official OpenAI tools
- Review MCP Client Logs: Check your MCP client's debug output
- Test Isolation: Run the server standalone to isolate issues
- Community Support: Check the main repository for issues and discussions
Security Considerations
- API Key Protection: Never commit API keys to version control
- Environment Variables: Use environment variables for sensitive configuration
- Network Security: The server only communicates with OpenAI's official API endpoints
- Input Validation: All inputs are validated before processing
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the troubleshooting section above
- Review the test output for specific error details
- Ensure your OpenAI API key has the necessary permissions for vector store operations
Related Projects
🔧 Enhanced Troubleshooting
@latest Package Issues
When to Use @latest
- NPM Cache Issues: If you're getting outdated versions despite updates
- Version Conflicts: When pinned versions conflict with dependencies
- Bug Fixes: To ensure you have the latest bug fixes and improvements
- Development: During active development when frequent updates are expected
# Clear NPM cache and install latest
npm cache clean --force
npx openai-vector-store-mcp@latest
# Force latest version installation
npm uninstall -g openai-vector-store-mcp
npx openai-vector-store-mcp@latest@latest vs Version Pinning Trade-offs
| Aspect | @latest | Pinned Version | |--------|---------|----------------| | Stability | May introduce breaking changes | Guaranteed consistent behavior | | Bug Fixes | Always includes latest fixes | May miss critical fixes | | Security | Latest security patches | May have known vulnerabilities | | Debugging | Easier to get support | Reproducible issues | | Team Sync | May cause version drift | Everyone uses same version |
Recommendation: Use @latest for development and testing, pin versions for production.
Client-Specific Troubleshooting
Claude Desktop Issues
- Server Not Loading: Check
claude_desktop_config.jsonsyntax - Permission Errors: Ensure config file is readable
- API Key Issues: Verify
OPENAI_API_KEYenvironment variable - Tool Failures: Check OpenAI API quota and billing
Claude Code CLI Issues
- Server Not Found: Run
claude mcp listto verify installation - Scope Problems: Check if server is in correct scope (local/project/user)
- Environment Variables: Ensure
.envfile or system variables are set - Project Config: Verify
.mcp.jsonfile syntax and permissions
Roo Integration Issues
- Tool Approval: Add tools to
alwaysAllowarray in config - Performance: Use stdio transport instead of HTTP proxy
- Debug Mode: Set
DEBUG=*environment variable - Config Location: Check
~/.config/roo/config.jsonpath
Troubleshooting Matrix
| Issue | Claude Desktop | Claude Code CLI | Roo |
|-------|----------------|-----------------|-----|
| Server won't start | Check config.json syntax | claude mcp get <name> | Check config.json syntax |
| API key errors | Set OPENAI_API_KEY env var | Use --env flag or .env | Set in config env section |
| Permission denied | Check file permissions | Check scope settings | Add to alwaysAllow |
| Tool not found | Restart Claude Desktop | claude mcp remove && add | Restart Roo |
| Slow performance | Use @latest version | Use stdio transport | Use stdio transport |
| Version conflicts | Use npx @latest | Use npx @latest | Use npx @latest |
Common Solutions
NPM and Node.js Issues
# Update Node.js and NPM
node --version # Should be 18+
npm --version # Should be 8+
# Clear all caches
npm cache clean --force
npx clear-npx-cache
# Reinstall with latest
npx openai-vector-store-mcp@latestOpenAI API Issues
# Test API key
curl -H "Authorization: Bearer $OPENAI_API_KEY" \
https://api.openai.com/v1/models
# Check quota
curl -H "Authorization: Bearer $OPENAI_API_KEY" \
https://api.openai.com/v1/usageEnvironment Variable Issues
# Check if variable is set
echo $OPENAI_API_KEY
# Set temporarily
export OPENAI_API_KEY="your-key-here"
# Set permanently (add to ~/.bashrc or ~/.zshrc)
echo 'export OPENAI_API_KEY="your-key-here"' >> ~/.bashrcBest Practices
Version Management
- Development: Always use
@latestfor newest features and fixes - Production: Pin to specific version after testing
- Team Projects: Use
.mcp.jsonwith pinned versions for consistency - CI/CD: Pin versions in deployment scripts
Security
- API Keys: Never commit API keys to version control
- Environment Variables: Use
.envfiles for local development - Permissions: Set appropriate file permissions on config files
- Rotation: Regularly rotate API keys
Performance
- Transport: Use stdio transport when possible (faster than HTTP)
- Caching: Leverage NPM cache for faster installs
- Updates: Keep packages updated for performance improvements
- Monitoring: Monitor API usage and costs
