nexlify-mcp-server 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
from typing import Any
|
2
|
+
import httpx
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
4
|
+
import logging
|
5
|
+
import os
|
6
|
+
|
7
|
+
# Initialize FastMCP server
|
8
|
+
mcp = FastMCP("weather")
|
9
|
+
logging.basicConfig(level=logging.INFO)
|
10
|
+
|
11
|
+
# Constants
|
12
|
+
USER_AGENT = "nexlify_mcp_server/1.0"
|
13
|
+
NEXLIFY_API_BASE_URI = os.environ.get("NEXLIFY_API_BASE_URI", "http://0.0.0.0:8000")
|
14
|
+
MCP_TIMEOUT = os.environ.get("MCP_TIMEOUT", "500") # 500 seconds
|
15
|
+
|
16
|
+
|
17
|
+
DEFAULT_ERROR_MESSAGE = "Sorry, we couldn't process your request to the Netlify API server at this time. Please try again later."
|
18
|
+
|
19
|
+
@mcp.tool()
|
20
|
+
def nexlify_search(query: str) -> str:
|
21
|
+
""" Search for a query using the Netlify API.
|
22
|
+
Args:
|
23
|
+
query (str): The search query.
|
24
|
+
Returns:
|
25
|
+
str: The search results.
|
26
|
+
"""
|
27
|
+
res = httpx.post(f"{NEXLIFY_API_BASE_URI}/search", json={"query": query}, headers={"User-Agent": USER_AGENT}, timeout=int(MCP_TIMEOUT)).json()
|
28
|
+
return res.get("response", DEFAULT_ERROR_MESSAGE)
|
29
|
+
|
30
|
+
|
31
|
+
def run() -> None:
|
32
|
+
"""Run the MCP server."""
|
33
|
+
mcp.run(transport='stdio')
|
34
|
+
|
35
|
+
if __name__ == "__main__":
|
36
|
+
# Initialize and run the server
|
37
|
+
logging.info("Starting Nexlify MCP server...")
|
38
|
+
run()
|
@@ -0,0 +1,86 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: nexlify-mcp-server
|
3
|
+
Version: 0.1.0
|
4
|
+
Summary: Add your description here
|
5
|
+
Author-email: Deepak Pant <mail2deepakpant@gmail.com>
|
6
|
+
License-Expression: MIT
|
7
|
+
Requires-Python: >=3.10
|
8
|
+
Requires-Dist: httpx>=0.28.1
|
9
|
+
Requires-Dist: mcp[cli]>=1.12.1
|
10
|
+
Description-Content-Type: text/markdown
|
11
|
+
|
12
|
+
# Nexlify MCP Server Package
|
13
|
+
|
14
|
+
## Overview
|
15
|
+
|
16
|
+
The Nexlify MCP Server is a lightweight Python package designed to integrate GitHub Copilot with the Nexlify AI system. It acts as a bridge, allowing developers to send queries from their IDE directly to the Nexlify API server—a CrewAI-based agentic AI service. This server executes queries against a vector database (powered by Qdrant) for internal documentation and performs restricted searches on whitelisted URLs (e.g., GitHub, StackOverflow) to retrieve relevant results. The package implements the Model Context Protocol (MCP) for seamless communication with GitHub Copilot, enhancing developer productivity by providing RAG-based (Retrieval-Augmented Generation) responses within the IDE[1].
|
17
|
+
|
18
|
+
Key features include:
|
19
|
+
- Simple query forwarding to the Nexlify CrewAI microservice.
|
20
|
+
- Support for semantic searches using embeddings stored in Qdrant.
|
21
|
+
- Restriction to whitelisted URLs for safe and targeted internet searches.
|
22
|
+
- Easy setup for local running and IDE integration.
|
23
|
+
|
24
|
+
This package is part of the Nexlify MVP, which leverages technologies like FastAPI, CrewAI, and OpenAI for embedding generation[1].
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
|
28
|
+
To install the Nexlify MCP package, use pip. It is published on PyPI for easy access.
|
29
|
+
|
30
|
+
```bash
|
31
|
+
pip install nexlify-mcp-server
|
32
|
+
```
|
33
|
+
|
34
|
+
### Requirements
|
35
|
+
- Python 3.10 or higher.
|
36
|
+
- Dependencies: `requests` (automatically installed via pip).
|
37
|
+
|
38
|
+
## Configuration
|
39
|
+
|
40
|
+
Before using the package, configure your environment and IDE.
|
41
|
+
|
42
|
+
### Environment Variables
|
43
|
+
Create a `.env` file in your project root with the following:
|
44
|
+
|
45
|
+
```
|
46
|
+
CREW_AI_URL=http://nexlify-ai-agentics-server:8001 # URL of the CrewAI microservice /search endpoint
|
47
|
+
```
|
48
|
+
|
49
|
+
Load these variables using `python-dotenv` if needed in custom scripts.
|
50
|
+
|
51
|
+
### IDE Setup
|
52
|
+
- **VS Code**: Add the MCP server configuration to `.vscode/mcp.json` or `settings.json`. Enable MCP discovery with `"chat.mcp.discovery.enabled": true` and specify the local server URL (e.g., `http://localhost:8000`)[1].
|
53
|
+
- **IntelliJ IDEA**: Configure via the Tools menu. Add the MCP server endpoint and enable integration for GitHub Copilot queries[1].
|
54
|
+
|
55
|
+
Ensure the Nexlify CrewAI microservice is running and accessible (e.g., via Docker Compose or AWS EC2 deployment).
|
56
|
+
|
57
|
+
## Usage
|
58
|
+
|
59
|
+
### Running the MCP Server
|
60
|
+
Run the server locally to handle queries from GitHub Copilot:
|
61
|
+
|
62
|
+
```bash
|
63
|
+
python -m nexlify_mcp
|
64
|
+
```
|
65
|
+
|
66
|
+
This starts a lightweight server that listens for MCP requests and forwards them to the configured CrewAI URL.
|
67
|
+
|
68
|
+
### Querying from IDE
|
69
|
+
Once running and configured in your IDE:
|
70
|
+
1. Open GitHub Copilot chat in VS Code or IntelliJ.
|
71
|
+
2. Submit a query (e.g., "How do I fix this Python error?").
|
72
|
+
3. The MCP server forwards the query to the CrewAI microservice.
|
73
|
+
4. The CrewAI service:
|
74
|
+
- Queries the vector database for internal results.
|
75
|
+
- Searches whitelisted URLs for external insights.
|
76
|
+
5. Consolidated results are returned and displayed in the IDE.
|
77
|
+
|
78
|
+
## Limitations
|
79
|
+
|
80
|
+
- Relies on the availability of the Nexlify CrewAI microservice.
|
81
|
+
- Queries are limited to text-based inputs; no support for file uploads in MVP.
|
82
|
+
- Internet searches are restricted to whitelisted URLs for safety[1].
|
83
|
+
|
84
|
+
## License
|
85
|
+
|
86
|
+
This package is licensed under the MIT License. See the LICENSE file in the repository for details.
|
@@ -0,0 +1,6 @@
|
|
1
|
+
nexlify_mcp_server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
nexlify_mcp_server/main.py,sha256=JDnx8zNfqMWKEv-CBIfqG3eqsvQD4vlOR43WB_96x9Q,1142
|
3
|
+
nexlify_mcp_server-0.1.0.dist-info/METADATA,sha256=qlCrZclbEUPatPEwHYaijxW6uWj5uRzVcaadNJzRTcY,3578
|
4
|
+
nexlify_mcp_server-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
5
|
+
nexlify_mcp_server-0.1.0.dist-info/entry_points.txt,sha256=F17B49KVb21i4Y4iqZq-BTreHZctcmwoO_VOEZXzTc4,67
|
6
|
+
nexlify_mcp_server-0.1.0.dist-info/RECORD,,
|