- Explore MCP Servers
- custom-mcp-article
Custom Mcp Article
What is Custom Mcp Article
custom-mcp-article is a practical implementation of the Model Context Protocol (MCP), developed by Anthropic, which allows AI models to interact with external services and tools. This repository demonstrates the core principles of the MCP through a simulated protocol.
Use cases
Use cases for custom-mcp-article include developing AI applications that require real-time data processing, integrating AI models into existing software systems, and experimenting with AI capabilities in a controlled environment.
How to use
To use custom-mcp-article, first set up your environment by installing the necessary dependencies and creating a virtual environment. Then, install Ollama and the required models. Finally, run the MCP server and clients using the provided commands to access the API and interact with the models.
Key features
Key features of custom-mcp-article include a fully functional MCP server, a client for data retrieval, and an alternative client implementation using OpenAI Agents. It provides an API for easy access to tools and models.
Where to use
custom-mcp-article can be used in fields such as artificial intelligence research, software development, and any application requiring interaction between AI models and external services.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Custom Mcp Article
custom-mcp-article is a practical implementation of the Model Context Protocol (MCP), developed by Anthropic, which allows AI models to interact with external services and tools. This repository demonstrates the core principles of the MCP through a simulated protocol.
Use cases
Use cases for custom-mcp-article include developing AI applications that require real-time data processing, integrating AI models into existing software systems, and experimenting with AI capabilities in a controlled environment.
How to use
To use custom-mcp-article, first set up your environment by installing the necessary dependencies and creating a virtual environment. Then, install Ollama and the required models. Finally, run the MCP server and clients using the provided commands to access the API and interact with the models.
Key features
Key features of custom-mcp-article include a fully functional MCP server, a client for data retrieval, and an alternative client implementation using OpenAI Agents. It provides an API for easy access to tools and models.
Where to use
custom-mcp-article can be used in fields such as artificial intelligence research, software development, and any application requiring interaction between AI models and external services.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
MCP своими руками: Запуск и тестирование
Этот репозиторий содержит практическую реализацию по материалам статьи “MCP своими руками”.
Что такое MCP?
Model Context Protocol (MCP) - это протокол, разработанный Anthropic, который позволяет моделям искусственного интеллекта взаимодействовать с внешними сервисами и инструментами. В данном репозитории представлена имитация подобного протокола, демонстрирующая основные принципы работы.
Структура проекта
server.py- MCP сервер, предоставляющий API для доступа к инструментамagent.py- клиент, использующий сервер для получения данныхagent_openai.py- альтернативная реализация с использованием библиотеки OpenAI Agents
Подготовка окружения
# Установка uv (если еще не установлен)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Создание виртуального окружения
uv venv
# Активация виртуального окружения
source .venv/bin/activate # для Linux/Mac
# или
.venv\Scripts\activate # для Windows
# Установка зависимостей из pyproject.toml
uv pip sync
Установка Ollama и моделей
Для работы с локальными моделями необходимо установить Ollama:
# Установка Ollama (Linux/Mac)
curl -fsSL https://ollama.com/install.sh | sh
# Запуск сервера Ollama
ollama serve
Для Windows скачайте установщик с официального сайта.
После установки Ollama необходимо скачать модель qwen2.5:14b:
# Скачивание модели qwen2.5:14b (в отдельном терминале)
ollama pull qwen2.5:14b
Вы можете проверить загруженные модели с помощью команды:
ollama list
Запуск сервера
# Запуск MCP сервера на порту 8000
uv run python server.py
После запуска сервер будет доступен по адресу http://localhost:8000, документация API доступна по адресу http://localhost:8000/docs.
Запуск клиентов
Клиент на базе OpenAI API
# Запуск стандартного клиента
uv run python agent.py
Клиент на базе OpenAI Agents
# Запуск клиента с использованием библиотеки OpenAI Agents
uv run python openai-agent.py
Примеры тестовых запросов
Прямой запрос к серверу MCP
# Получение списка доступных инструментов
curl http://localhost:8000/tools
# Получение цены акции Сбербанка
curl "http://localhost:8000/get_stock_price?ticker=SBER"
# Получение цены акции Газпрома
curl "http://localhost:8000/get_stock_price?ticker=GAZP"
Взаимодействие с агентом
После запуска клиента agent.py или openai-agent.py вы можете задать следующие вопросы:
- “Какая сейчас цена акций Сбербанка?”
- “Сколько стоят акции Газпрома на Московской бирже?”
- “Цена на акции Аэрофлота?”
Требования к системе
- Python 3.12 или выше
- Доступ к интернету для получения данных с Московской биржи
- Запущенный сервер Ollama с поддерживаемыми моделями
- uv - быстрый менеджер пакетов для Python (https://github.com/astral-sh/uv)
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










