We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/htakeda777/fal_openai_image1'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
CLAUDE.md•1.4 KiB
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Common Commands
- **Development**: `npm run dev` - Run server in development mode with hot reload
- **Build**: `npm run build` - Compile TypeScript to JavaScript in dist/
- **Production**: `npm start` - Run the compiled server from dist/
## Environment Variables
This MCP server requires two API keys to function:
- `FAL_KEY` - Authentication for fal.ai API
- `OPENAI_API_KEY` - Used in BYOK (Bring Your Own Key) system for image generation
## Architecture
This is a FastMCP (Model Context Protocol) server that bridges fal.ai's GPT image-1 text-to-image API.
**Core Structure:**
- Single TypeScript file (`src/index.ts`) implementing the MCP server
- Uses `@modelcontextprotocol/sdk` for MCP protocol handling
- StdioServerTransport for communication
- Single tool: `generate_image` with comprehensive parameter validation
**API Integration:**
- Makes HTTP requests to `https://fal.run/fal-ai/gpt-image-1/text-to-image/byok`
- Dual authentication: fal.ai API key in Authorization header + OpenAI key in request body
- Supports image size, quality, background, and count parameters
- Returns structured JSON with image URLs or error details
**Error Handling:**
- Environment variable validation at runtime
- API response error handling with detailed messages
- Structured error responses in MCP format