Skip to main content
Glama

MCP Car Database

MCP 项目

这是一个已完成的项目,使用 MCP(模型上下文协议)协议进行客户端和服务器之间的通信。该项目包括创建一个 SQLite 数据库并实现一个查询该数据库的客户端。

文件夹结构

📁 mcp-车
│--📂 应用程序
│ │ │ server.py # MCP 服务器文件
│ │ │ database.py # 负责创建数据库的脚本
│-📂 客户端
│ │ │ client.py # 交互发生的主要客户端代码
│-📂有用
│ │ │ create_cars.py # 为数据库生成虚拟数据
│-- README.md # 项目文档

如何旋转项目

  1. 创建并配置虚拟环境
    • 为了确保所有项目依赖项都正确安装,建议创建一个虚拟环境。
    • 在项目的根目录下,运行以下命令来创建虚拟环境:python -m venv venv马上:.\venv\Scripts\activate因此要下载依赖项:pip install -r requirements.txt
    • 这将安装项目正常运行所需的所有库。

现在您可以继续进行其余的项目配置,虚拟环境已准备就绪可供使用。

  1. 创建数据库
    • 导航到app文件夹。
    • 打开database.py文件并运行它以在“数据”文件夹中创建 SQLite 格式的数据库。该脚本将创建存储汽车数据所需的结构。
  2. 使用虚拟数据填充数据库
    • 访问utils文件夹。
    • 打开create_cars.py文件并运行它,用 100 条虚构的汽车记录填充数据库。此步骤是必要的,以便在运行系统之前在数据库中拥有数据。
  3. 运行客户端并查询数据
    • 填写完数据库后,转到client文件夹。
    • 运行client.py文件与系统交互。代理将允许您输入过滤器(例如品牌、型号、年份等)来在数据库中搜索汽车。

使用示例

运行客户端( client.py )时,系统将提示您输入搜索条件,例如:

  • 标记
  • 模型
  • 颜色
  • 最高价格

客户端将向服务器发送查询,服务器将搜索数据库并返回符合提供条件的汽车。

您可以随时输入**“exit”**来停止搜索。


贡献

请根据需要随意探索和修改项目。如果您有任何疑问或想要提出改进建议,请提交请求或联系我们。

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

使用模型上下文协议的客户端-服务器系统允许用户查询虚构汽车数据的 SQLite 数据库。

  1. 文件夹结构
    1. 如何旋转项目
      1. 使用示例
        1. 贡献

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.
            Last updated -
            6
            9
            TypeScript
            MIT License
            • Apple
          • -
            security
            -
            license
            -
            quality
            A Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.
            Last updated -
            Python
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.
            Last updated -
            • Apple
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables SQL operations (SELECT, INSERT, UPDATE, DELETE) and table management through a standardized interface with SQLite databases.
            Last updated -
            JavaScript

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gabriel-Maxsy/MCP-Car'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server