Skip to content

Add Xquik MCP agent example - #694

Open
kriptoburak wants to merge 1 commit into
lastmile-ai:mainfrom
kriptoburak:feature/xquik-mcp-agent-example
Open

Add Xquik MCP agent example#694
kriptoburak wants to merge 1 commit into
lastmile-ai:mainfrom
kriptoburak:feature/xquik-mcp-agent-example

Conversation

@kriptoburak

@kriptoburak kriptoburak commented May 24, 2026

Copy link
Copy Markdown

Summary

  • Add a runnable mcp-agent example that connects to Xquik's hosted Streamable HTTP MCP server.
  • Include config, env, secrets, requirements, and a read-only agent prompt for X/Twitter research workflows.
  • Keep write actions behind explicit human approval in the example instructions.

Validation

  • python3 -m py_compile examples/mcp/mcp_xquik/main.py
  • ruby -e 'require "yaml"; ARGV.each { |path| YAML.load_file(path) }' examples/mcp/mcp_xquik/mcp_agent.config.yaml examples/mcp/mcp_xquik/mcp_agent.secrets.yaml.example
  • uv run ruff check examples/mcp/mcp_xquik/main.py
  • git diff --cached --check
  • Link check: https://dashboard.xquik.com/en/account, https://github.com/lastmile-ai/mcp-agent, https://xquik.com/server.json, and https://xquik.com/openapi.json returned 200. https://xquik.com/mcp returned 401 without credentials, which is expected for the API-key-gated MCP endpoint.

Summary by CodeRabbit

  • New Features
    • Added an Xquik MCP Agent example demonstrating connection to the hosted MCP server and discovery of read-only endpoints.
  • Documentation
    • Added a step-by-step setup guide, including configuration/secrets, environment variables (with an XQUIK_API_KEY placeholder), and security guidance for approving write actions.
  • Chores
    • Added example configuration, secrets template, environment template, and a local dependency list to run the example.

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0404783c-79e2-4c68-9ffd-e9f99e04180c

📥 Commits

Reviewing files that changed from the base of the PR and between 4b08cd5 and 27afb38.

📒 Files selected for processing (6)
  • examples/mcp/mcp_xquik/.env.example
  • examples/mcp/mcp_xquik/README.md
  • examples/mcp/mcp_xquik/main.py
  • examples/mcp/mcp_xquik/mcp_agent.config.yaml
  • examples/mcp/mcp_xquik/mcp_agent.secrets.yaml.example
  • examples/mcp/mcp_xquik/requirements.txt
🚧 Files skipped from review as they are similar to previous changes (4)
  • examples/mcp/mcp_xquik/mcp_agent.secrets.yaml.example
  • examples/mcp/mcp_xquik/requirements.txt
  • examples/mcp/mcp_xquik/mcp_agent.config.yaml
  • examples/mcp/mcp_xquik/main.py

📝 Walkthrough

Walkthrough

Adds a new Xquik MCP Agent example with Streamable HTTP configuration, API-key and OpenAI secret templates, dependency setup, a runnable async workflow for tool discovery and read-only endpoint planning, and local setup documentation.

Changes

Xquik MCP Agent Example

Layer / File(s) Summary
Configuration and dependencies
examples/mcp/mcp_xquik/mcp_agent.config.yaml, examples/mcp/mcp_xquik/mcp_agent.secrets.yaml.example, examples/mcp/mcp_xquik/.env.example, examples/mcp/mcp_xquik/requirements.txt
Configures the asyncio engine, debug logging, Xquik’s Streamable HTTP server with the x-api-key header, and OpenAI model settings; adds credential placeholders and dependencies.
Agent execution flow
examples/mcp/mcp_xquik/main.py
Starts MCPApp, connects an Agent to Xquik, lists remote tools, uses OpenAIAugmentedLLM to generate a read-only endpoint plan, logs the result, and reports runtime.
Setup and usage documentation
examples/mcp/mcp_xquik/README.md
Documents the discovery flow, local installation, credential configuration, execution command, remote server URL, and x-api-key authentication.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Script as mcp_xquik script
  participant App as MCPApp
  participant Agent as Agent
  participant Xquik as Xquik MCP server
  participant LLM as OpenAIAugmentedLLM
  Script->>App: run example_usage()
  App->>Agent: connect to xquik
  Agent->>Xquik: list available tools
  Xquik-->>Agent: return tools
  Agent->>LLM: provide tools and read-only planning request
  LLM-->>Script: return endpoint path and query fields
Loading

Possibly related PRs

Suggested reviewers: saqadri, andrew-lastmile

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an Xquik MCP agent example.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/mcp/mcp_xquik/main.py`:
- Line 19: Do not log the full config object (the logger.info call that passes
context.config.model_dump()) because it may contain secrets; instead change the
logger call to only emit non-sensitive fields or a sanitized version of the
config — e.g., build a filtered dict from context.config (or call a mask/redact
option on model_dump if available) that excludes or masks keys like api_key,
auth_token, secret, or headers before passing to logger.info so no raw
credentials are written to logs; update the call site that uses
context.config.model_dump() accordingly.

In `@examples/mcp/mcp_xquik/requirements.txt`:
- Line 2: Replace the non-portable "mcp-agent @ file://../../../" requirement
with a relative path spec so pip can resolve it; for example change the line in
requirements.txt from "mcp-agent @ file://../../../" to a relative install entry
like "-e ../../../" (or "../../../" if not editable) to point at the local
mcp-agent project root.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 60d95120-801d-499f-ae0d-8153a3a8f3ab

📥 Commits

Reviewing files that changed from the base of the PR and between f62d849 and 10c22c2.

📒 Files selected for processing (6)
  • examples/mcp/mcp_xquik/.env.example
  • examples/mcp/mcp_xquik/README.md
  • examples/mcp/mcp_xquik/main.py
  • examples/mcp/mcp_xquik/mcp_agent.config.yaml
  • examples/mcp/mcp_xquik/mcp_agent.secrets.yaml.example
  • examples/mcp/mcp_xquik/requirements.txt

Comment thread examples/mcp/mcp_xquik/main.py Outdated
Comment thread examples/mcp/mcp_xquik/requirements.txt Outdated
@kriptoburak

Copy link
Copy Markdown
Author

Follow-up on the CodeRabbit items: both were addressed in the latest branch commit, 4b08cd5.

  • main.py no longer logs the full config object; it logs only the xquik server name.
  • requirements.txt now uses -e ../../../ instead of a non-portable file:// requirement.

Validation:

  • python3 -m py_compile examples/mcp/mcp_xquik/main.py
  • git diff --check

@kriptoburak
kriptoburak force-pushed the feature/xquik-mcp-agent-example branch from 4b08cd5 to 27afb38 Compare July 20, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant