Proyecto MCP personalizado
Este proyecto aprovecha la biblioteca mcp con soporte CLI y se integra con la API de OpenAI.
Requisitos
Asegúrese de instalar las dependencias necesarias antes de ejecutar el proyecto:
pip install -r requirements.txtRelated MCP server: OpenAI API MCP Server
Uso
Configure su clave API de OpenAI como una variable de entorno:
export OPENAI_API_KEY="your-api-key"Inicie el servidor MCP:
python server.pyUtilice el cliente para interactuar con el servidor:
python client.pyAlternativamente, utilice el orquestador para consultar el LLM y las herramientas:
python main.py
Ejemplo
Consultar la herramienta meteorológica
Ejecute el cliente y llame a la herramienta get_weather :
python client.pyEjemplo de interacción:
You: List tools
Assistant: {
"tools": [
{
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {
"city": {
"type": "string",
"description": "Name of the city"
}
}
}
]
}
You: Call get_weather with {"city": "Beijing"}
Assistant: 北京的天气是晴天Dependencias
openai==1.70.0mcp[cli]==1.6.0
Licencia
Este proyecto está licenciado bajo la licencia MIT.
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.