Sample

openai-mcp-test
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "kkyy3402-openai-mcp-test": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>",
        "VECTOR_STORE_ID": "<YOUR_VECTOR_STORE_ID>"
      }
    }
  }
}

You run a lightweight MCP server that enables semantic search and document fetch capabilities by connecting to an OpenAI vector store, so your ChatGPT workflows can search across documents and retrieve full content when needed.

How to use

Register this MCP server with your MCP client to enable Search and Fetch tools. The server exposes an SSE-based MCP endpoint at http://0.0.0.0:8000, which lets your ChatGPT workflows perform vector-based searches and fetch full document contents. Use the Search tool to surface relevant documents and the Fetch tool to retrieve complete documents by ID.

How to install

# Prerequisites
# Ensure you have Python 3.9+ installed

# 1. Clone the project repository
# Replace with your actual repository URL
git clone <your-repo-url>
cd <project-folder>

# 2. (Optional) Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate  # macOS/Linux
# Windows users: .venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Create configuration file with required environment variables
# The server expects these values in a .env file at project root
# Example content shown below
OPENAI_API_KEY=your_openai_api_key
VECTOR_STORE_ID=your_vector_store_id

# 5. Run the MCP server
python server.py

Additional sections

Configuration and security. The server relies on environment variables to authorize with the OpenAI API and to select the vector store. Keep OPENAI_API_KEY and VECTOR_STORE_ID secure and do not commit them to public repositories.

Server behavior notes. The server uses SSE to communicate with the client. Logs are emitted at INFO level by default and include request/startup details so you can monitor usage and troubleshoot quickly.

Troubleshooting. If you cannot reach http://0.0.0.0:8000, ensure your environment allows binding to port 8000 and that there are no firewall rules blocking access. Confirm that your .env file contains valid OPENAI_API_KEY and VECTOR_STORE_ID values and that you activated your virtual environment before running the server.

Available tools

search

Query the vector store for documents related to your query and return a list of matching documents with IDs, titles, excerpts, and URLs.

fetch

Fetch the full content of a document by its ID, including title, full text, URL, and metadata.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational