fabrx
v1.0.3
Published
MCP server for Fabrx - Build APIs from documents in your IDE
Maintainers
Readme
Fabrx MCP Server
Build APIs from documents directly in your IDE using the Model Context Protocol
Transform documents into production-ready APIs without leaving your code editor. The Fabrx MCP Server integrates seamlessly with MCP-compatible IDEs (Windsurf, Cursor, Claude Desktop) to provide AI-powered API generation.
Features
- 🔐 Secure Device Authentication - OAuth 2.0 device flow (like GitHub CLI)
- 📄 Document Processing - Upload PDFs, images, spreadsheets
- 🏗️ Schema Generation - AI-powered schema extraction
- 🚀 One-Click Deployment - Deploy APIs instantly
- 📊 Usage Analytics - Monitor API performance
- 🛠️ 11 MCP Tools - Full API management from your IDE
Installation
The Fabrx MCP server is available as an npm package. No installation required - use npx to run it directly:
npx fabrx loginOr install globally:
npm install -g fabrxRequirements:
- Node.js 18.0.0 or higher
- MCP-compatible IDE (Windsurf, Cursor, Claude Desktop, etc.)
Quick Start
1. Authenticate
fabrx-mcp loginThis will:
- Open your browser for authorization
- Show a device code (e.g.,
ABC-123) - Generate and store your API key securely
2. Configure Your IDE
Choose your IDE and follow the configuration instructions:
Config Location: ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"fabrx": {
"command": "npx",
"args": ["-y", "fabrx"],
"env": {
"FABRX_API_URL": "https://app.fabrx.ai"
}
}
}
}Note: Restart Windsurf after adding the configuration.
Config Location: ~/.cursor/mcp.json
{
"mcpServers": {
"fabrx": {
"command": "npx",
"args": ["-y", "fabrx"],
"env": {
"FABRX_API_URL": "https://app.fabrx.ai"
}
}
}
}Or install in one click: Add to Cursor (coming soon)
Note: Restart Cursor after adding the configuration.
Config Locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"fabrx": {
"command": "npx",
"args": ["-y", "fabrx"],
"env": {
"FABRX_API_URL": "https://app.fabrx.ai"
}
}
}
}Note: Restart Claude Desktop after adding the configuration.
Config Location: ~/.continue/config.json
{
"mcpServers": {
"fabrx": {
"command": "npx",
"args": ["-y", "fabrx"],
"env": {
"FABRX_API_URL": "https://app.fabrx.ai"
}
}
}
}Note: Reload VS Code window after adding the configuration.
3. Use in Your IDE
Now you can ask your AI assistant:
"Use Fabrx to create an API from this invoice.pdf"
"Deploy my invoice schema as an API"
"Show me my Fabrx usage stats"
Available Tools
The MCP server provides 11 tools for managing your Fabrx APIs:
Schema Management
- list_schemas - List all your schemas
- get_schema - Get schema details
- create_schema - Create a new schema
- update_schema - Modify existing schema
- delete_schema - Remove a schema
API Management
- list_apis - List deployed APIs
- get_api - Get API details
- deploy_schema - Deploy schema as API
- delete_api - Remove deployed API
Document Processing
- process_document - Upload and process documents
Account
- get_usage_stats - View usage statistics
Example Usage
Process a Document
// AI assistant will use this tool automatically
"Process invoice.pdf and create a schema"The MCP server will:
- Read the file
- Upload to Typeless
- Generate schema with AI
- Return the schema structure
Deploy an API
"Deploy my invoice schema as 'invoice-processor' API"Results in:
- Live API endpoint
- Automatic documentation
- Ready for production use
Check Usage
"What's my API usage this month?"Returns:
- API call counts
- Response times
- Error rates
- Cost breakdown
CLI Commands
# Authenticate
fabrx-mcp login
# Check status
fabrx-mcp status
# Start server (usually automatic)
fabrx-mcp start
# Logout
fabrx-mcp logout
# Help
fabrx-mcp helpConfiguration
Environment Variables
# Optional: Custom API URL
export FABRX_API_URL=https://fabrx.ai
# Optional: Custom device name
export DEVICE_NAME="My Laptop"Config File
Configuration is stored in:
- macOS/Linux:
~/.fabrx/config.json - Windows:
%USERPROFILE%\.fabrx\config.json
{
"apiUrl": "https://fabrx.ai",
"apiKey": "fbx_mcp_xxxxx",
"deviceName": "My Laptop"
}Security
Authentication
The Fabrx MCP server uses OAuth 2.0 Device Authorization Grant (RFC 8628), similar to GitHub CLI:
- Run
fabrx-mcp login - Browser opens with a device code
- Sign in and approve the device
- API key is generated and stored locally
Security Features
- ✅ Local Storage - API keys stored in
~/.fabrx/config.json(like GitHub CLI) - ✅ Server-Side Hashing - Keys hashed with SHA-256 before storage
- ✅ One-Time Display - Keys shown only once during login
- ✅ User Approval - Explicit device authorization required
- ✅ Revocable - Keys can be revoked anytime from dashboard
Security Risks & Best Practices
Prompt Injection
Like all LLM integrations, the MCP server is susceptible to prompt injection attacks. An attacker could trick the LLM into executing malicious commands through user content.
Recommendations:
- Manual Approval - Always review tool calls before executing (enabled by default in most MCP clients)
- Development First - Use with development/staging environments, not production
- Least Privilege - Only grant access to necessary resources
- Monitor Usage - Regularly check API usage for anomalies
- Rotate Keys - Periodically re-authenticate to get fresh keys
Revoking Access
From Dashboard:
- Go to https://app.fabrx.ai/settings/devices
- Find your device
- Click "Revoke Access"
From CLI:
fabrx-mcp logoutIf you lose your API key:
- Run
fabrx-mcp logout - Run
fabrx-mcp loginagain - Approve the new device
Troubleshooting
"Not logged in" error
fabrx-mcp login"Invalid API key" error
Your key may have been revoked. Re-authenticate:
fabrx-mcp logout
fabrx-mcp loginMCP server not appearing in IDE
- Check IDE MCP configuration
- Restart IDE after config changes
- Verify installation:
which fabrx-mcp
Connection errors
Check API URL:
fabrx-mcp statusVerify connectivity:
curl https://fabrx.ai/api/healthDevelopment
Build from Source
git clone https://github.com/fabrx-ai/mcp-server.git
cd mcp-server
npm install
npm run build
npm linkRun Tests
npm testDevelopment Mode
npm run devAPI Reference
FabrxClient
import { FabrxClient } from '@fabrx/mcp-server';
const client = new FabrxClient(
'https://fabrx.ai',
'your-api-key'
);
// List schemas
const schemas = await client.listSchemas();
// Create schema
const schema = await client.createSchema('Invoice', {
type: 'object',
properties: {
total: { type: 'number' },
date: { type: 'string' }
}
});
// Deploy API
const result = await client.deploySchema(schema.id, 'invoice-api');
console.log(result.endpoint_url);DeviceFlowClient
import { DeviceFlowClient } from '@fabrx/mcp-server';
const auth = new DeviceFlowClient('https://fabrx.ai');
const token = await auth.authorize({
apiUrl: 'https://fabrx.ai',
deviceName: 'My App',
openBrowser: true
});
console.log('API Key:', token.access_token);Examples
Example 1: Process Multiple Documents
// AI: "Process all PDFs in this folder"
// MCP server will:
for (const file of pdfFiles) {
await processDocument({ file_path: file });
}Example 2: Batch Deploy APIs
// AI: "Deploy all my schemas"
const schemas = await listSchemas();
for (const schema of schemas) {
if (schema.status === 'draft') {
await deploySchema(schema.id, `${schema.name}-api`);
}
}Example 3: Monitor Performance
// AI: "How are my APIs performing?"
const stats = await getUsageStats('7d');
console.log(`
Total Requests: ${stats.total_requests}
Success Rate: ${stats.success_rate}%
Avg Response Time: ${stats.avg_response_time}ms
`);Integrations
Works With
- ✅ Windsurf - AI-powered IDE
- ✅ Cursor - AI code editor
- ✅ Claude Desktop - Anthropic's desktop app
- ✅ Any MCP-compatible application
Coming Soon
- VS Code extension
- JetBrains plugin
- Emacs package
Resources
- Documentation: https://fabrx.ai/docs
- MCP Guide: https://fabrx.ai/docs/mcp
- API Reference: https://fabrx.ai/docs/api
- Examples: https://github.com/fabrx-ai/examples
- Discord: https://discord.gg/fabrx
Support
- Issues: https://github.com/fabrx-ai/mcp-server/issues
- Email: [email protected]
- Discord: https://discord.gg/fabrx
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
MIT © Fabrx
Changelog
v1.0.2 (2025-10-16)
- 📝 Docs: Enhanced README with IDE-specific configurations following Supabase/Stripe patterns
- 📝 Docs: Added collapsible IDE sections for better navigation
- 📝 Docs: Improved security documentation with prompt injection warnings
v1.0.1 (2025-10-16)
- 🐛 Fix: Browser opening with correct URL (trim newlines from server response)
v1.0.0 (2025-10-13)
- 🎉 Initial release
- 🔐 Device flow authentication (OAuth 2.0)
- 🛠️ 11 MCP tools for full API management
- 📄 Document processing support
- 📊 Usage analytics and monitoring
Made with ❤️ by Fabrx
Transform documents into APIs in seconds, not days.
