Token导航 LogoToken导航TokenDH.com
ffMCP (Brandonhenry) logo
开发工具stdio官方级别未说明来源级核验

ffMCP (Brandonhenry)

MCP Server

ffmcp是一个统一接口的命令行工具,支持访问多种AI服务,包括文本生成、图像处理、语音转换等功能,适用于开发者和技术爱好者。

工具数

0

提示词数

0

GitHub Stars

4

资源数

0
命令行工具PythonClaude开发工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

brandonhenry

提供方

brandonhenry

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install ffmcp

详细介绍

ffmcp

ffmcp -受ffmpeg启发的AI命令行工具。通过统一界面从命令行访问任何AI服务。

](https://pypi.org/project/ffmcp/) ](https://pypi.org/project/ffmcp/) ](https://www.npmjs.com/package/ffmcp) ](https://www.npmjs.com/package/ffmcp)

通过pip安装: pip install ffmcp | 通过npm安装: npm install -g ffmcp | 从源代码安装:安装 在......下面

特性

  • 🚀 统一CLI:多个AI提供商的单一命令行界面
  • 🔌 11个AI提供商:OpenAI、Anthropic、谷歌Gemini、Groq、DeepSeek、Mistral AI、Together AI、Cohere、困惑、AI33和AIMLAPI
  • 📝 简单:与ffmpeg一样工作-简单、强大、可组合
  • 🔧 可配置的:轻松管理API密钥和设置
  • 📊 流媒体:响应的实时流媒体支持
  • 🎨 完全支持OpenAI:所有OpenAI功能,包括视觉、图像、音频、嵌入和助手
  • 🧠 Zep/LEANN记忆(大脑):使用Zep(云/自托管)或LEANN(本地,节省97%的存储空间)创建大脑,存储/检索聊天记忆、收藏和图表
  • 🤖 代理:具有模型、指令、大脑、动态属性和动作(网络、图像、视觉、嵌入)的命名代理
  • 👥 多代理团队:代理可以在团队中协同工作,委派任务,并协作完成复杂的目标
  • 💬 线程:聊天和代理的对话历史记录-维护多个交互的上下文
  • 🎤 画外音/TTS:多个提供商(ElevenLabs)的全文转语音支持、语音管理和代理语音集成

安装

选项1:管道安装(推荐)

安装ffmcp最简单的方法是通过pip:

# Install the base package
pip install ffmcp

# Or install with specific providers
pip install ffmcp[openai]
pip install ffmcp[anthropic]
pip install ffmcp[zep]      # Zep memory support
pip install ffmcp[leann]    # LEANN memory support (optional, requires system dependencies)
pip install ffmcp[all]      # All providers (does not include LEANN - install separately if needed)

注: 在装有Homebrew Python的macOS上,您可能会遇到“外部管理环境”错误。使用虚拟环境:

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install ffmcp

选项2:npm安装

先决条件: 你需要同时安装Python包(通过pip)和npm包。

  1. 安装Python包 (必填):
   pip install ffmcp
  1. 安装npm包:
   # Install globally (for CLI usage)
   npm install -g ffmcp

   # Or install locally in your project
   npm install ffmcp

注: npm包是Python CLI的包装器。必须安装这两个软件包才能正常工作。

选项3:从源代码安装(开发)

为了开发或获取最新功能:

# Clone the repository
git clone https://github.com/brandonhenry/ffmcp.git
cd ffmcp

# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

# Or install with specific providers
pip install -e ".[openai]"
pip install -e ".[anthropic]"
pip install -e ".[all]"

要求:

  • Python版本:支持Python 3.8到3.14。
  • Node.js版本:npm包要求Node.js>=14.0.0。

快速开始

1.配置API密钥

# Set OpenAI API key
ffmcp config -p openai -k YOUR_OPENAI_API_KEY

# Set Anthropic API key
ffmcp config -p anthropic -k YOUR_ANTHROPIC_API_KEY

# Set Google Gemini API key
ffmcp config -p gemini -k YOUR_GEMINI_API_KEY

# Set Groq API key
ffmcp config -p groq -k YOUR_GROQ_API_KEY

# Set DeepSeek API key
ffmcp config -p deepseek -k YOUR_DEEPSEEK_API_KEY

# Set Mistral AI API key
ffmcp config -p mistral -k YOUR_MISTRAL_API_KEY

# Set Together AI API key
ffmcp config -p together -k YOUR_TOGETHER_API_KEY

# Set Cohere API key
ffmcp config -p cohere -k YOUR_COHERE_API_KEY

# Set Perplexity API key
ffmcp config -p perplexity -k YOUR_PERPLEXITY_API_KEY

# Set AI33 API key
ffmcp config -p ai33 -k YOUR_AI33_API_KEY

# Set AIMLAPI API key
ffmcp config -p aimlapi -k YOUR_AIMLAPI_API_KEY

# Set ElevenLabs API key (for voiceover/TTS)
ffmcp config -p elevenlabs -k YOUR_ELEVENLABS_API_KEY

# Or use environment variables (provider name in uppercase)
export OPENAI_API_KEY=your_key
export ANTHROPIC_API_KEY=your_key
export GEMINI_API_KEY=your_key
export GROQ_API_KEY=your_key
export DEEPSEEK_API_KEY=your_key
export MISTRAL_API_KEY=your_key
export TOGETHER_API_KEY=your_key
export COHERE_API_KEY=your_key
export PERPLEXITY_API_KEY=your_key
export AI33_API_KEY=your_key
export AIMLAPI_API_KEY=your_key
export ELEVENLABS_API_KEY=your_key

2.生成文本

# Basic generation
ffmcp generate "Write a haiku about coding"

# With specific provider and model
ffmcp generate "Explain quantum computing" -p openai -m gpt-4
ffmcp generate "Explain quantum computing" -p gemini -m gemini-1.5-pro
ffmcp generate "Explain quantum computing" -p groq -m llama-3.1-70b-versatile
ffmcp generate "Explain quantum computing" -p deepseek -m deepseek-chat
ffmcp generate "Explain quantum computing" -p mistral -m mistral-large-latest
ffmcp generate "Explain quantum computing" -p together -m meta-llama/Llama-3-70b-chat-hf
ffmcp generate "Explain quantum computing" -p cohere -m command-r-plus
ffmcp generate "Explain quantum computing" -p perplexity -m llama-3.1-sonar-large-128k-online

# Stream the response
ffmcp generate "Tell me a story" -s

# With system message
ffmcp generate "Solve this math problem" --system "You are a helpful math tutor"

# Read from file
ffmcp generate -i prompt.txt -o output.txt

# Pipe input
echo "Summarize this" | ffmcp generate

# Output as JSON
ffmcp generate "Write a haiku" --json

# Output as array
ffmcp generate "Write a haiku" --array

3.聊天模式

# Conversational chat
ffmcp chat "Hello, how are you?" -p anthropic

# With system message
ffmcp chat "What is 2+2?" -s "You are a helpful math tutor"

# Chat with thread (maintains conversation history)
ffmcp chat "Hello" -t conversation1
ffmcp chat "What did I just say?" -t conversation1  # Remembers previous messages

# Output as JSON
ffmcp chat "Write a haiku" --json

# Output as array
ffmcp chat "Write a haiku" --array

# Thread management
ffmcp thread create conversation1
ffmcp thread list
ffmcp thread use conversation1
ffmcp thread current
ffmcp thread clear conversation1
ffmcp thread delete conversation1

4.代理人

# Create an agent (any provider, default actions enabled)
ffmcp agent create myagent -p openai -m gpt-4o-mini -i "You are a helpful assistant" --brain mybrain
ffmcp agent create gemini-agent -p gemini -m gemini-2.0-flash-exp -i "You are a helpful assistant"
ffmcp agent create groq-agent -p groq -m llama-3.1-70b-versatile -i "You are a helpful assistant"

# Create an agent with voice (for TTS)
ffmcp agent create myagent -p openai -m gpt-4o-mini -i "You are a helpful assistant" --voice my-voice

# Create an agent with instructions from a file
ffmcp agent create myagent -p openai -m gpt-4o-mini -f instructions.txt --brain mybrain

# List and select the active agent
ffmcp agent list
ffmcp agent use myagent

# Show details
ffmcp agent show

# Thread Management (conversation history)
ffmcp agent thread create myagent thread1
ffmcp agent thread list myagent
ffmcp agent thread use myagent thread1
ffmcp agent thread current myagent
ffmcp agent thread clear myagent thread1
ffmcp agent thread delete myagent thread1

# Run the agent (uses active thread automatically)
ffmcp agent run "Plan a 3-day trip to Paris and fetch top sights"

# Run with specific thread
ffmcp agent run "Continue planning" --thread thread1

# Output as JSON
ffmcp agent run "Write a summary" --json

# Output as array
ffmcp agent run "Write a summary" --array

# Manage properties and actions
ffmcp agent prop set myagent timezone UTC
ffmcp agent action enable myagent web_fetch
ffmcp agent action disable myagent generate_image

主题:对话历史 有关详细线程文档的部分。

5.多代理团队(分层)

代理可以在分层团队中协同工作,以完成复杂的任务。团队在顶部使用编排器代理,通过将任务委派给成员或子团队来编排协作。所有活动都在层次结构中向上流动,顶级编排器可以通过共享的大脑/内存查看所有内容。

# Create specialized agents
ffmcp agent create researcher -p openai -m gpt-4o-mini -i "You are a research specialist. Focus on finding and analyzing information."
ffmcp agent create writer -p openai -m gpt-4o-mini -i "You are a writing specialist. Focus on creating clear, well-structured content."
ffmcp agent create orchestrator -p openai -m gpt-4o-mini -i "You are a project orchestrator. Break down tasks and delegate to team members."

# Enable delegation action for orchestrator (allows it to delegate to other agents)
ffmcp agent action enable orchestrator delegate_to_agent

# Create a simple team with orchestrator and members
ffmcp team create research-team -o orchestrator -m researcher -m writer

# Create a shared brain for team memory (flows up hierarchy)
ffmcp brain create team-brain
ffmcp team create project-team -o orchestrator -m researcher -m writer -b team-brain

# Create nested teams (teams within teams)
# First create sub-teams
ffmcp agent create sub-orchestrator-1 -p openai -m gpt-4o-mini -i "You coordinate a research sub-team"
ffmcp agent action enable sub-orchestrator-1 delegate_to_agent
ffmcp team create research-sub-team -o sub-orchestrator-1 -m researcher -b team-brain

ffmcp agent create sub-orchestrator-2 -p openai -m gpt-4o-mini -i "You coordinate a writing sub-team"
ffmcp agent action enable sub-orchestrator-2 delegate_to_agent
ffmcp team create writing-sub-team -o sub-orchestrator-2 -m writer -b team-brain

# Create top-level team with sub-teams
ffmcp team create main-team -o orchestrator -s research-sub-team -s writing-sub-team -b team-brain

# Run a task with the hierarchical team (orchestrator delegates as needed)
ffmcp team run "Research and write a comprehensive report on quantum computing" --team main-team

# Output as JSON
ffmcp team run "Create a report" --team main-team --json

# Output as array
ffmcp team run "Create a report" --team main-team --array

# List teams
ffmcp team list

# Show team details including hierarchy
ffmcp team show main-team

# Add/remove members and sub-teams
ffmcp team add-member main-team analyst
ffmcp team add-sub-team main-team analysis-sub-team
ffmcp team remove-member main-team analyst

# Set a different orchestrator
ffmcp team set-orchestrator main-team new-orchestrator

分层团队的工作方式:

  • 编排器:顶层有一个代理,负责接收任务并协调协作
  • 成员:编排器下方的直接代理成员
  • 子团队:嵌套团队,拥有自己的编排者和成员(支持多层)
  • 共享大脑:在层次结构中向上流动的内存上下文-顶级编排器可以看到所有活动
  • 授权:编排者可以委托给成员或子团队编排者
  • 能见度:所有活动都在层次结构中向上流动,使顶级编排者完全可见

层次结构示例:

main-team (orchestrator: ceo)
├── research-sub-team (orchestrator: research-manager)
│   ├── researcher-1
│   └── researcher-2
├── writing-sub-team (orchestrator: writing-manager)
│   ├── writer-1
│   └── writer-2
└── direct-member (analyst)

工作流程示例:

# 1. Create agents for different roles
ffmcp agent create ceo -p openai -m gpt-4o-mini -i "You are a CEO orchestrating multiple teams"
ffmcp agent create research-manager -p openai -m gpt-4o-mini -i "You manage a research team"
ffmcp agent create writing-manager -p openai -m gpt-4o-mini -i "You manage a writing team"
ffmcp agent create researcher-1 -p openai -m gpt-4o-mini -i "You are a researcher"
ffmcp agent create writer-1 -p openai -m gpt-4o-mini -i "You are a writer"

# 2. Enable delegation for orchestrators
ffmcp agent action enable ceo delegate_to_agent
ffmcp agent action enable research-manager delegate_to_agent
ffmcp agent action enable writing-manager delegate_to_agent

# 3. Create shared brain for team memory
ffmcp brain create org-brain

# 4. Create sub-teams
ffmcp team create research-team -o research-manager -m researcher-1 -b org-brain
ffmcp team create writing-team -o writing-manager -m writer-1 -b org-brain

# 5. Create top-level team with sub-teams
ffmcp team create org-team -o ceo -s research-team -s writing-team -b org-brain

# 6. Run a complex task - CEO orchestrates, delegates to sub-teams, sees all activity
ffmcp team run "Create a comprehensive market analysis report" --team org-team

OpenAI功能

视觉/图像理解

# Analyze images
ffmcp openai vision "What's in this image?" image1.jpg image2.png

# With custom model and options
ffmcp openai vision "Describe this" photo.jpg -m gpt-4o -t 0.5

图像生成(DALL·E)

# Generate image with DALL·E 3
ffmcp openai image "A futuristic cityscape at sunset"

# DALL·E 2 with custom size
ffmcp openai image "A cat wearing sunglasses" -m dall-e-2 --size 512x512

# High quality with natural style
ffmcp openai image "Abstract art" --quality hd --style natural

# Save URL to file
ffmcp openai image "Beautiful landscape" -o image_url.txt

音频转录(耳语)

# Transcribe audio to text
ffmcp openai transcribe audio.mp3

# With language hint
ffmcp openai transcribe audio.mp3 -l es

# With prompt for better accuracy
ffmcp openai transcribe meeting.mp3 -p "This is a technical meeting about AI"

# Output as JSON with timestamps
ffmcp openai transcribe audio.mp3 --json -o transcript.json

音频翻译

# Translate audio to English
ffmcp openai translate spanish_audio.mp3

# With prompt
ffmcp openai translate audio.mp3 -p "Technical presentation"

文本转语音

# Convert text to speech
ffmcp openai tts "Hello, world!" output.mp3

# With custom voice and speed
ffmcp openai tts "Welcome to the future" speech.mp3 -v nova -s 1.2

# High quality model
ffmcp openai tts "Important announcement" announcement.mp3 -m tts-1-hd

画外音/TTS系统

ffmcp包括一个全面的画外音/TTS系统,支持多个提供商(从ElevenLabs开始)。您可以创建语音配置,管理它们,并将它们与代理相关联。

设置

# Configure ElevenLabs API key
ffmcp config -p elevenlabs -k YOUR_ELEVENLABS_API_KEY

# Or use environment variable
export ELEVENLABS_API_KEY=your_key

发现可用的声音

# List all voices from ElevenLabs
ffmcp voiceover provider list --provider elevenlabs

# Show details of a specific voice
ffmcp voiceover provider show --provider elevenlabs 21m00Tcm4TlvDq8ikWAM

创建语音配置

# Create a voice configuration with default settings
ffmcp voiceover create my-voice \
  --provider elevenlabs \
  --voice-id 21m00Tcm4TlvDq8ikWAM \
  --description "My favorite voice"

# Create with custom settings
ffmcp voiceover create narrator \
  --provider elevenlabs \
  --voice-id pNInz6obpgDQGcFmaJgB \
  --model-id eleven_multilingual_v2 \
  --stability 0.5 \
  --similarity-boost 0.75 \
  --style 0.0 \
  --use-speaker-boost \
  --output-format mp3_44100_128 \
  --description "Narrator voice for stories"

管理语音配置

# List all saved voices
ffmcp voiceover list

# Show voice details
ffmcp voiceover show my-voice

# Update voice settings
ffmcp voiceover update my-voice --stability 0.6 --similarity-boost 0.8

# Delete a voice
ffmcp voiceover delete my-voice

生成语音

# Using a saved voice configuration
ffmcp tts "Hello, this is a test" output.mp3 --voice my-voice

# Using provider and voice ID directly
ffmcp tts "Direct voice usage" output.mp3 \
  --provider elevenlabs \
  --voice-id 21m00Tcm4TlvDq8ikWAM

# With custom parameters (overrides saved config)
ffmcp tts "Custom settings" output.mp3 \
  --voice my-voice \
  --stability 0.7 \
  --similarity-boost 0.9

代理语音集成

# Create agent with voice
ffmcp agent create assistant \
  -p openai \
  -m gpt-4o-mini \
  -i "You are a helpful assistant" \
  --voice my-voice

# Set voice for existing agent
ffmcp agent voice set assistant my-voice

# Show agent's voice
ffmcp agent voice show assistant

# Remove voice from agent
ffmcp agent voice remove assistant

语音参数:

  • --stability (0.0-1.0):控制语音稳定性(较低=变化较大)
  • --similarity-boost (0.0-1.0):控制与原始声音的相似性
  • --style (0.0-1.0):控制风格夸张
  • --use-speaker-boost:启用扬声器增强功能,使语音更清晰
  • --output-format:音频格式(例如。, mp3_44100_128, pcm_16000等等)
  • --model-idTTS模型(例如。, eleven_multilingual_v2, eleven_turbo_v2)

支持的提供商:

  • ElevenLabs:支持语音克隆的高质量多语言TTS
  • 更多供应商即将推出!

嵌入

# Create embeddings
ffmcp openai embed "This is a sample text"

# With custom dimensions
ffmcp openai embed "Vectorize this" -d 256

# Output full JSON with usage stats
ffmcp openai embed "Text to embed" --json -o embeddings.json

函数调用/工具

# Chat with function calling
# First, create a tools.json file:
cat > tools.json       # Create thread
ffmcp thread list               # List all threads
ffmcp thread use          # Set active thread
ffmcp thread current            # Show active thread
ffmcp thread clear        # Clear messages
ffmcp thread delete       # Delete thread

代理线程:

ffmcp agent thread create      # Create thread
ffmcp agent thread list               # List threads
ffmcp agent thread use          # Set active thread
ffmcp agent thread current            # Show active thread
ffmcp agent thread clear        # Clear messages
ffmcp agent thread delete      # Delete thread

示例工作流程

聊天线程工作流:

# Create and use a thread
ffmcp thread create project-planning
ffmcp thread use project-planning

# Have a conversation
ffmcp chat "I want to build a web app" -p openai
ffmcp chat "What technologies should I use?" -p openai
ffmcp chat "Tell me more about React" -p openai

# Switch to different thread
ffmcp thread create personal-chat
ffmcp thread use personal-chat
ffmcp chat "What's the weather like?" -p openai  # Fresh conversation

代理线程工作流:

# Create agent and thread
ffmcp agent create assistant -p openai -m gpt-4o-mini -i "You are helpful"
ffmcp agent thread create assistant project-a
ffmcp agent thread use assistant project-a

# Run agent with conversation history
ffmcp agent run "Research React best practices" --agent assistant
ffmcp agent run "Find examples of React hooks" --agent assistant  # Uses web_fetch action

# Create another thread for different project
ffmcp agent thread create assistant project-b
ffmcp agent thread use assistant project-b
ffmcp agent run "Research Python frameworks" --agent assistant  # Fresh conversation

Zep/LEANN记忆(大脑)

注: 大脑与线程是分开的。线程在本地维护对话历史,而大脑提供高级内存功能,包括语义搜索、文档存储和图形关系。你可以同时使用这两种方法——代理可以有对话历史线程,也可以有长期记忆和文档搜索大脑。

后端选项:

  • 泽普:云或自托管内存平台(需要云的API密钥)
  • 黎安:本地矢量索引可节省97%的存储空间,完全在服务器上运行(不需要API密钥)

设置

Zep设置(云或自托管)

# Configure Zep (Cloud)
export ZEP_CLOUD_API_KEY=your_key

# Optional for self-hosted
export ZEP_BASE_URL=http://localhost:8000

# Or persist settings
ffmcp config -p zep -k YOUR_ZEP_API_KEY

LEANN设置(本地,不需要API密钥)

# First, install LEANN separately (requires system dependencies)
# LEANN is optional and not included in default installation
pip install leann

# Or install ffmcp with LEANN support
pip install ffmcp[leann]

# LEANN works out of the box - no API key needed!
# Optional: Configure index directory (defaults to ~/.ffmcp/leann_indexes)
export LEANN_INDEX_DIR=/path/to/indexes

# Or persist settings
ffmcp config set-leann-index-dir /path/to/indexes

注: LEANN需要 leann-backend-hnsw 这可能需要系统依赖性。如果安装失败,您仍然可以在没有LEANN的情况下使用Zep后端。

大脑

# Create a Zep brain (default)
ffmcp brain create my-zep-brain --backend zep

# Create a LEANN brain (local, no API key needed)
ffmcp brain create my-leann-brain --backend leann

# Create with default session ID
ffmcp brain create mybrain --session-id session-123

# List all brains (shows backend type)
ffmcp brain list
# Output: my-zep-brain (zep) *
#         my-leann-brain (leann)

# Use a brain
ffmcp brain use mybrain
ffmcp brain current

记忆

Zep和LEANN后端的内存操作相同:

# Add a message to memory
ffmcp brain memory add --role user --role-type user --content "Who was Octavia Butler?"

# Get memory context
ffmcp brain memory get

# Get memory for a specific brain and session
ffmcp brain memory get --brain mybrain --session session-123

# Search memory
ffmcp brain memory search "Octavia"

# Clear memory for session
ffmcp brain memory clear

笔记:

  • 省略 --brain 使用活跃的大脑(设置为 ffmcp brain use).
  • 省略 --session 默认为大脑的 default_session_id (如果设置)或大脑名称。
  • Zep和LEANN都支持相同的内存操作。

收藏和文件

收集和文档操作对两个后端的工作方式相同:

# Create a namespaced collection under the brain
ffmcp brain collection create knowledge --description "KB for mybrain"

# Add a document
ffmcp brain document add knowledge --text "Zep is a memory platform for LLM apps" --id doc1

# Search documents
ffmcp brain document search knowledge "memory platform"

图表(仅限Zep Cloud)

图形操作仅适用于Zep Cloud后端:

# Add JSON data to user graph
echo '{"projects": {"alpha": {"status": "in progress"}}}' | \
  ffmcp brain graph add user-123 --type json --input -

# Get user graph
ffmcp brain graph get user-123

注: Graph API在LEANN后端不可用。使用Zep Cloud后端进行图形操作。

LEANN特定操作

LEANN提供了额外的直接索引管理命令:

# Build a LEANN index directly from files/directories
ffmcp brain leann build my-index ./documents/ --backend hnsw

# List all LEANN indexes
ffmcp brain leann list

# Search a LEANN index directly
ffmcp brain leann search my-index "query text" --top-k 10

# Remove a LEANN index
ffmcp brain leann remove my-index --force

在Zep和LEANN之间进行选择

在以下情况下使用Zep:

  • 你需要图形关系
  • 您需要云托管内存
  • 您需要实时协作功能
  • 您有一个Zep Cloud API密钥

在以下情况下使用LEANN:

  • 您需要100%的本地/专用存储(不需要API密钥)
  • 您需要最高的存储效率(节省97%)
  • 您正在自己的服务器上运行
  • 您希望避免外部依赖
  • 您不需要图形功能

两个后端都支持:

  • 内存操作(添加、获取、搜索、清除)
  • 藏品和文件
  • 语义搜索
  • 元数据过滤
  • 会话管理

用法示例

基本文本生成

ffmcp generate "Write a Python function to calculate fibonacci"

高级选项

ffmcp generate "Creative story" \
  -p openai \
  -m gpt-4 \
  -t 0.9 \
  --max-tokens 500 \
  -s

文件处理

# Process a file
ffmcp generate -i input.txt -o output.txt

# Chain operations
cat data.txt | ffmcp generate | grep "important" > filtered.txt

脚本集成

#!/bin/bash
RESULT=$(ffmcp generate "Translate to French: Hello world" -p openai)
echo "Translation: $RESULT"

程序化使用(Node.js/JavaScript)

如果你是通过npm安装的,你可以在Node.js项目中以编程方式使用ffmcp:

const ffmcp = require('ffmcp');

// Generate text
const result = await ffmcp.generate('Write a haiku about coding', {
  provider: 'openai',
  model: 'gpt-4',
  temperature: 0.7
});
console.log(result);

// Chat with AI
const response = await ffmcp.chat('Hello, how are you?', {
  provider: 'anthropic',
  system: 'You are a helpful assistant',
  thread: 'conversation1'
});
console.log(response);

// Stream responses
const stream = ffmcp.streamGenerate('Tell me a story', {
  provider: 'openai'
});

stream.on('data', (chunk) => {
  process.stdout.write(chunk);
});

stream.on('end', () => {
  console.log('\nDone!');
});

// Configure API keys
await ffmcp.config('openai', 'your-api-key-here');

// List providers
const providers = await ffmcp.providers();
console.log(providers);

// Execute raw commands
const output = await ffmcp.raw(['agent', 'list']);
console.log(output);

TypeScript支持:

import ffmcp from 'ffmcp';

const result = await ffmcp.generate('Hello', {
  provider: 'openai',
  model: 'gpt-4',
  temperature: 0.7
});

看 获取完整的npm包文档。

完整工作流示例

# 1. Transcribe audio
ffmcp openai transcribe meeting.mp3 -o transcript.txt

# 2. Summarize transcript
ffmcp generate -i transcript.txt -o summary.txt

# 3. Generate image based on summary
ffmcp openai image "$(cat summary.txt | head -c 100)"

# 4. Create embeddings for search
ffmcp openai embed "$(cat transcript.txt)" -o embeddings.json

支持的AI提供商

ffmcp支持11家主要的人工智能提供商,每家都有自己的优势:

提供商型号主要功能最适合
开放人工智能GPT-4、GPT-3.5、DALL·E、Whisper全功能集(视觉、图像、音频、嵌入)全面的人工智能任务
Anthropic克劳德3.5十四行诗,克劳德3作品集长篇背景,高质量复杂推理,长篇文档
谷歌双子座Gemini 2.0 Flash,Gemini 1.5 Pro多模式,快速通用,视觉任务
GroqLlama 3.1、Mixtral、Gemma超快速推理速度关键型应用程序
深度求索DeepSeek聊天,DeepSeek程序员兼容OpenAI,专注于编码代码生成,技术任务
米斯特拉尔AIMistral Large,Pixtral高质量,视觉支持企业应用程序
一起AILlama、Mixtral、Qwen等等访问许多开源模型实验,成本效益高
凝聚Command R+,Command R企业功能,RAG业务应用程序,嵌入
困惑度Sonar Large,Sonar Pro内置网络搜索、引用研究、实时信息
AI33多种型号多型号接入通用
AIMLAPI300多种型号统一的API300多种型号的单一API,OpenAI兼容可访问多种型号

违约模型

每个提供者都有一个合理的默认模型:

  • OpenAI: gpt-4o-mini
  • 人类学: claude-3-5-sonnet-20241022
  • 双子座: gemini-2.0-flash-exp
  • Groq: llama-3.1-70b-versatile
  • DeepSeek: deepseek-chat
  • 米斯特拉尔: mistral-large-latest
  • 一起: meta-llama/Llama-3-70b-chat-hf
  • 科恩: command-r-plus
  • 困惑: llama-3.1-sonar-large-128k-online
  • AI33:(因型号而异)
  • AIMLAPI: gpt-4o

您可以使用以下命令覆盖默认值 -m 标记或设置自定义默认值:

ffmcp config set-default-model gemini gemini-1.5-pro

建筑

ffmcp/
├── ffmcp/
│   ├── __init__.py
│   ├── cli.py              # Main CLI interface
│   ├── config.py           # Configuration management
│   ├── providers/
│   │   ├── __init__.py
│   │   ├── base.py         # Base provider interface
│   │   ├── openai_provider.py      # Full OpenAI implementation
│   │   ├── anthropic_provider.py   # Anthropic Claude
│   │   ├── gemini_provider.py      # Google Gemini
│   │   ├── groq_provider.py        # Groq
│   │   ├── deepseek_provider.py    # DeepSeek
│   │   ├── mistral_provider.py     # Mistral AI
│   │   ├── together_provider.py   # Together AI
│   │   ├── cohere_provider.py      # Cohere
│   │   └── perplexity_provider.py  # Perplexity AI
│   └── voiceover/
│       ├── __init__.py
│       ├── base.py         # Base TTS provider interface
│       └── elevenlabs_provider.py   # ElevenLabs TTS implementation
├── setup.py
├── requirements.txt
└── README.md

支持的OpenAI功能

  • 聊天完成 -GPT-4、GPT-3.5、GPT-4o型号
  • 视觉 -GPT-4视觉图像理解
  • DALL·E - 图像生成(DALL·E 2 & 3)
  • 耳语 -音频转录和翻译
  • 文本转语音 -TTS-1和TTS-1-HD型号
  • 嵌入 -语义搜索的文本嵌入
  • 函数调用 -工具和函数调用支持
  • 助理API -创建和管理AI助手
  • 流媒体 -实时流式传输所有文本生成

支持画外音/TTS功能

  • 多个TTS提供商 -ElevenLabs(更多内容即将推出)
  • 语音配置管理 -创建、读取、更新、删除语音配置
  • 提供商语音发现 -列出并探索可用的声音
  • 代理语音集成 -为代理分配语音
  • 灵活的TTS生成 -使用保存的配置或直接参数
  • 高级语音设置 -稳定性、相似性、风格、扬声器增强
  • 多种输出格式 -MP3、PCM等

添加新提供商

要添加新的AI提供者:

  1. 在中创建新文件 ffmcp/providers/ (例如。, cohere_provider.py)
  2. 从……继承…… BaseProvider 并实施所需的方法
  3. 在中注册 ffmcp/providers/__init__.py

例子:

from ffmcp.providers.base import BaseProvider

class CohereProvider(BaseProvider):
    def get_provider_name(self) -> str:
        return 'cohere'
    
    def generate(self, prompt: str, **kwargs) -> str:
        # Implementation
        pass
    # ... implement other methods

路线图

  • \[x\] OpenAI全功能支持
  • \[x\] 多个AI提供商(支持9个提供商!)
  • \[x\] 图像生成支持
  • \[x\] 音频转录/翻译
  • \[x\] 具有多个提供商的语音/TTS系统
  • \[x\] 代理语音集成
  • \[x\] 面向Node.js/JavaScript用户的npm包
  • \[\]批量处理
  • \[\]自定义提供者的插件系统
  • \[\]用于编程的Python API
  • \[x\] 高级功能(函数调用、工具使用等)
  • \[\]供应商特定功能(Gemini vision、Cohere-RAG等)

供应商文件

有关每个提供程序的详细信息,请参阅 提供者.md (如果可用)或运行:

ffmcp providers

有关全面的画外音/TTS文档,请参阅 VOICEOVER.md.

有关npm包的使用和Node.jsJavaScript API文档,请参阅 .

贡献

欢迎投稿!请随时提交拉取请求。

许可证

MIT许可证

目录标签

目录标签

命令行工具PythonClaude开发工具本地部署AI服务多模态处理开发者工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP