Skip to main content

A sample client implementation to interact with Kyvos MCP server.

Project description

MCP Kyvos Sample Client

The mcp-kyvos-sample-client is a sample client implementation that demonstrates how to interact with a Kyvos MCP server. It enables users to send natural language queries using either:

  • SSE (Server-Sent Events) for web-based communication, or
  • STDIO for command-line interaction.

The client supports both Basic Authentication and OAuth 2.0, with credentials and the Kyvos platform URL specified through a JSON configuration file. It uses Azure OpenAI as the LLM backend.

Installation

Install the MCP Kyvos sample client package from pip:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mcp-kyvos-sample-client==1.7

Configuration Overview

The client configuration is defined in a JSON file (e.g., mcp.json) or via environment files. There are two primary properties:

  1. clientConfiguration
  2. mcpServers
{
  "clientConfiguration": {
    "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
    "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
    "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name",
    "AZURE_OPENAI_API_VERSION": "2025-01-01-preview",
    "AUTH_TYPE": "basic"
  },
  "mcpServers": {
    "my-stdio-server": {
      "type": "stdio",
      "command": "mcp-kyvos-server",
      "args": [
        "--env-file", "/path/to/.env"
      ]
    }
  }
}

Client Credentials

These settings apply globally to the MCP client and control logging and authentication to Azure OpenAI:

Parameter Description Example Required Default value
log_level Log level. Options: DEBUG (default), INFO "INFO" No "DEBUG"
log_file File path for client logs. "/var/log/mcp/client.log" No -
AZURE_OPENAI_API_KEY API key for Azure OpenAI. "abc123..." Yes -
AZURE_OPENAI_ENDPOINT Azure OpenAI resource endpoint URL. "https://your-resource.openai.azure.com/" Yes -
AZURE_OPENAI_DEPLOYMENT_NAME Name of the Azure OpenAI model deployment to use. "your-deployment-name" Yes -
AZURE_OPENAI_API_VERSION Azure OpenAI API version. "2025-01-01-preview" No "2025-01-01-preview"
AUTH_TYPE Type of authorization the client uses. basic or oauth No oauth
CLIENT_PORT The port on which the client receives the OAuth callback from the server. 3001 No 3000
FOLDER_NAME Folder name to use for getting available semantic models. "Business Catalog" No -

Example:

"clientConfiguration": {
  "LOG_LEVEL": "INFO",
  "LOG_FILE": "/var/log/mcp/client.log",
  "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
  "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
  "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name",
  "AZURE_OPENAI_API_VERSION": "2025-01-01-preview",
  "FOLDER_NAME": "Business_Catalog"
}

STDIO Mode

Runs synchronously over standard input/output, ideal for scripts and pipelines.

Connect with stdio:

Field Description Examples Required
type Server connection type. "stdio" or "sse" No
command The command used to start the server executable. Must be an absolute path or available on the system PATH. "uv", "python", or any command installed via pip. Yes
args Array of arguments passed to the command. ["--kyvos-url", "https://your-kyvos-endpoint", "--verify-ssl", "false"] Yes
env Environment variables for the server. "USERNAME": "user123" No

Example configuration in mcp.json:

{
  "clientConfiguration": {
    "LOG_LEVEL": "INFO",
    "LOG_FILE": "/var/log/mcp/analytics-stdio.log",
    "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
    "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
    "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name",
    "AZURE_OPENAI_API_VERSION": "2025-01-01-preview"
  },
  "mcpServers": {
    "my-stdio-server": {
      "type": "stdio",
      "command": "mcp-kyvos-server",
      "args": [
        "--kyvos-url", "https://your-kyvos-endpoint",
        "--kyvos-username", "user123",
        "--kyvos-password", "secret",
        "--kyvos-prompt-file", "./prompt.txt",
        "--kyvos-default-folder", "/shared/folder",
        "--verify-ssl", "false"
      ]
    }
  }
}

Or via environment file:

{
  "clientConfiguration": {
    "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
    "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
    "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name"
  },
  "mcpServers": {
    "my-stdio-server": {
      "type": "stdio",
      "command": "mcp-kyvos-server",
      "args": [
        "--env-file", "/path/to/.env"
      ]
    }
  }
}

Or set env vars:

{
  "clientConfiguration": {
    "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
    "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
    "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name"
  },
  "mcpServers": {
    "my-stdio-server": {
      "type": "stdio",
      "command": "mcp-kyvos-server",
      "args": [],
      "env": {
        "KYVOS_URL": "https://your-kyvos-endpoint",
        "KYVOS_USERNAME": "user123",
        "KYVOS_PASSWORD": "secret"
      }
    }
  }
}

SSE Mode

Provides a persistent stream of responses from the MCP Kyvos server using HTTP SSE protocol.

Connect with sse:

Field Description Examples Required
type Server connection type. "sse" No
url URL of the SSE server. "http://<machine_ip>:<port>/sse" Yes
username Username for HTTP Basic Auth. "user123" No
password Password for HTTP Basic Auth. "secret" No

Note: Username and password will be base64 encoded and passed as a Basic Auth token in the Authorization header.

Note: The type parameter is optional. If a url is provided, the client will automatically detect the type as sse; if a command is provided, it will detect stdio mode.

Tip: Ensure that the MCP server is running before starting the client in SSE mode.

{
  "clientConfiguration": {
    "LOG_LEVEL": "DEBUG",
    "LOG_FILE": "/var/log/mcp/analytics-sse.log",
    "AZURE_OPENAI_API_KEY": "your-azure-openai-api-key-here",
    "AZURE_OPENAI_ENDPOINT": "https://your-resource-name.openai.azure.com/",
    "AZURE_OPENAI_DEPLOYMENT_NAME": "your-deployment-name",
    "AZURE_OPENAI_API_VERSION": "2025-01-01-preview"
  },
  "mcpServers": {
    "analytics-sse": {
      "type": "sse",
      "url": "http://<machine_ip>:port/sse",
      "username": "user123",
      "password": "secret"
    }
  }
}

For reference on the MCP Kyvos server and its supported command-line arguments, see mcp-kyvos-server.


Running the Client

To start the MCP Kyvos sample client using a configuration file, run:

mcp-kyvos-sample-client --config /path/to/mcp.json

Note: On error like "Your input exceeds the context window of this model" use the command /clear to reset the context. All previous context will be lost after using this command.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_kyvos_sample_client-1.0.0a3.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_kyvos_sample_client-1.0.0a3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_kyvos_sample_client-1.0.0a3.tar.gz.

File metadata

File hashes

Hashes for mcp_kyvos_sample_client-1.0.0a3.tar.gz
Algorithm Hash digest
SHA256 dd14a69d634a1460f9cf28e692666aa1792f92f7d4def76d4d2b92e932f8d30d
MD5 81abda360dfbd89fa7e457f78efa9f54
BLAKE2b-256 e0b76d2ce828851440c06055b20321f82198147022672b9ebda128a97df45359

See more details on using hashes here.

File details

Details for the file mcp_kyvos_sample_client-1.0.0a3-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_kyvos_sample_client-1.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0aa4dffe9c71a46012579a09a10b07769cfe5830bda01ab9897a09d67aef506
MD5 aa77a650a1c03894a906cbca9f3606c7
BLAKE2b-256 edc084c2a53c5def7696b0297205f3a4dcd44a83923877a010ed9309c8575d9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page