Skip to main content

A Python CLI package that provides an interactive interface to Dview’s DMCP server. Users can submit queries directly from the command line, which are processed on the server using MCP tools, with results returned seamlessly to the user.

Project description

DMCP Setu

Effortless Conversational Access to Dview MCP from Your Terminal

DMCP Setu is a lightweight, terminal-first Python CLI tool that enables real-time interaction with Dview’s MCP (Message Control Plane). It abstracts authentication, WebSocket handling, and streaming so you can focus purely on communication.

⚡ Built for developers who prefer speed, simplicity, and the terminal.


🚀 Overview

DMCP Setu allows you to:

  • Authenticate with Dview services
  • Establish real-time WebSocket communication
  • Send and receive messages interactively
  • Stream live responses directly in your terminal

⚠️ This is a CLI utility, not a Python SDK.


✨ Features

  • 🔐 Flexible Authentication

    • Email & Password
    • Cookie-based (token=Bearer xxxx)
  • 🌐 Real-Time Messaging

    • WebSocket-based communication
    • Live streaming responses
  • 💬 Interactive CLI

    • Chat-like interface
    • Built with Rich for clean output
  • ⚙️ Configurable

    • Environment variable support
    • Custom endpoint support

📦 Installation

Using pip

pip install dmcp-setu

Using poetry

poetry add dmcp-setu

⚙️ Configuration

You must configure the Cosmos endpoint before using the CLI.

Environment Variable (Recommended)

export DVIEW_COSMOS_ENDPOINT="https://<your-cosmos-endpoint>"

Or via CLI

dmcp chat --cosmos <endpoint>

🔐 Authentication

1. Email & Password

dmcp chat --email <email> --password <password>

Or interactive mode:

dmcp chat

2. Cookie-Based Authentication

dmcp chat --cookie "token=Bearer xxxx"

Or via environment variable:

export DMCP_COOKIE="token=Bearer xxxx"

💬 Usage

Start the CLI:

dmcp chat

Example

you  ▶ Hello

⋯ Processing...

dmcp ▶ Hi! How can I help you today?

Exit

  • Type exit or quit
  • Press Ctrl + C

🧠 How It Works

  1. Credentials are validated via Cosmos API
  2. WebSocket connection is established
  3. Authentication token is sent
  4. Server responds with auth_ok
  5. Interactive chat session begins

🌍 Environment Variables

Variable Description
DVIEW_COSMOS_ENDPOINT Cosmos API endpoint (required)
DMCP_EMAIL Email for authentication
DMCP_PASSWORD Password for authentication
DMCP_COOKIE Cookie for authentication
DMCP_WS_URL Override WebSocket URL

🛠 Error Handling

User-friendly CLI errors:

  • ❌ Authentication Failed
  • ❌ Missing Values
  • ❌ Connection Error
  • ❌ Unexpected Error

All internal exceptions are abstracted.


🎯 Use Cases

  • Internal Dview tooling
  • MCP debugging
  • Workflow testing
  • CLI-based automation

⚠️ Important Notes

  • This is a CLI-only tool
  • Internal classes like _DMCP are not public APIs
  • Direct imports may break in future versions

🧾 Best Practices

  • Use environment variables for credentials
  • Prefer cookie-based auth for persistent sessions
  • Avoid relying on internal modules

🔗 Repository

GitHub: https://github.com/dview-io/dmcp-setu


📄 License

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

dmcp_setu-0.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

dmcp_setu-0.1.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file dmcp_setu-0.1.1.tar.gz.

File metadata

  • Download URL: dmcp_setu-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.7 Darwin/22.2.0

File hashes

Hashes for dmcp_setu-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b98f484a6fd42f0ec23b5792ef85277cb9934cd8c8bb6865f1f0563fc923b077
MD5 32b596779215cb46bf187817c8b87a79
BLAKE2b-256 6902daec6c4f555277788963346e8889d68320cef0857aeb23137abd2383979e

See more details on using hashes here.

File details

Details for the file dmcp_setu-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dmcp_setu-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.7 Darwin/22.2.0

File hashes

Hashes for dmcp_setu-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f56f17ac254fde848f182044aaabff75a0ecef241ce608062d6972f0797f8d4
MD5 99eefe42592be411804f9d914f2613e1
BLAKE2b-256 1bf585127385aa32535c3e1adcd92bf45ab291fc09a72734ada070be8e0c3fcb

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