Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
04fc91e
implemented mcp
3rd-Son Apr 17, 2025
baa02fb
implemented mcp (#22)
3rd-Son Apr 17, 2025
7ae43c2
fix(pydantic_ai): Consistent code according to updated pydantic library
AryanGurav106 Apr 17, 2025
53a00a5
fix(mcp + pydantic_ai): Added proper MCP integration and server initi…
Sakalya100 Apr 19, 2025
5912425
fix: mcp server initialization updated
Sakalya100 Apr 20, 2025
2a9552b
fix: mcp coder agent issue fixed
Sakalya100 Apr 22, 2025
d68feff
Rebased HITL and Planning in Phases in MCP Integration
3rd-Son Apr 17, 2025
1175faa
Rebased HITL and Planning in Phases in MCP integration
AryanGurav106 Apr 17, 2025
df88643
fix(mcp + pydantic_ai): Added proper MCP integration and server initi…
Sakalya100 Apr 19, 2025
f8e1272
fix: mcp server initialization updated
Sakalya100 Apr 20, 2025
ab20c88
Rebased changes from HITL + Planning in phases
Sakalya100 Apr 23, 2025
2c83372
Added HITL + Planning in Phases to Server
Sakalya100 Apr 23, 2025
43330d6
Added HITL + Planning in Phases to Server
Sakalya100 Apr 23, 2025
5f78eea
Revert previous commit
Sakalya100 Apr 23, 2025
7cb628e
Added context to mcp server tools
Sakalya100 Apr 24, 2025
db31548
refactor(MCP server integration and update Dockerfile):
AryanGurav106 Apr 24, 2025
f80608f
refactor(MCP Server Tool Integration)
Sakalya100 Apr 24, 2025
6801d4d
Enhance agent section generation to avoid duplication
AryanGurav106 Apr 26, 2025
d88f9f6
feat(ServerManager for MCP):
AryanGurav106 Apr 26, 2025
2d970f3
refactor(MCP Server Management and Tool Registration):
Sakalya100 Apr 28, 2025
6ac5bcc
feat: added external mcp server support
Sakalya100 Apr 29, 2025
df9f0fa
feat: added maps server
Sakalya100 May 2, 2025
8dfb698
feat: updated mcp server config to include Google Maps server
Sakalya100 May 2, 2025
1a3f2e7
feat: Added dynamic prompt update + External Server streaming
Sakalya100 May 3, 2025
8f046f5
Added MCP Server detailed setup steps in README.md with sample queries
Sakalya100 May 5, 2025
f3de914
Updated README.md with proper formatting
Sakalya100 May 5, 2025
835de2a
feat: mcp page ui added
May 27, 2025
2e62b22
feat: mcp server pages ui for each mcp server button added
May 27, 2025
ef5fd6d
feat(mcp apis):
Sakalya100 May 28, 2025
d904f04
feat: MCP landing page ans server page UI
May 28, 2025
7bd5200
fix: MCP page UI
May 28, 2025
a033f70
feat:MCP UI for landing page and each server section dynamically
May 28, 2025
8a51400
fix: MCP page UI
May 28, 2025
361f5b7
feat: enhance MCP service components with improved error handling and UX
AshuMishraG May 29, 2025
a8f7a72
chore: simplify frontend feedback to user-friendly messages; delegate…
AshuMishraG May 29, 2025
3b27475
fix: UI changes to make the service pages dynamic
May 29, 2025
a69f73e
Merge branch 'feature/mcp_integration' into mcp_ui_integration
Sakalya100 May 29, 2025
21bead9
Mcp UI integration (#31)
AryanGurav106 Jun 16, 2025
0263bd7
(fix): Fixes for duplicate tool registration in MCP Server
Sakalya100 Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@

.env

node_modules/
package-lock.json
package.json
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,71 @@ This project uses HashiCorp Cloud Platform (HCP) Vault for secure secrets manage
#### WebSocket
- `VITE_WEBSOCKET_URL=ws://localhost:8081/ws`

---
### Configuring External MCP Servers (OPTIONAL)

CortexON supports integration with external MCP (Model Context Protocol) servers for extended capabilities. Configure these in the `cortex_on/config/external_mcp_servers.json` file.

#### 1. GitHub Personal Access Token

1. **Create a GitHub Account** if you don't already have one at [github.com](https://github.com)

2. **Generate a Personal Access Token (PAT)**:
- Follow the steps as listed here: [Personal Access Token Setup](https://github.com/modelcontextprotocol/servers/tree/main/src/github#setup)

3. **Add the Token to Your Configuration**:
- Open `cortex_on/config/external_mcp_servers.json`
- Find the GitHub section and replace the empty token:
```json
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_YourTokenHere"
}
```
4. **Sample Queries**
- Update the README.md file in the <repo_name> repository by <github_username> on branch main. Insert the line "Changed by CortexOn" in the end. Provide the updated file content as the content parameter and set branch as main.
- List the latest commit and in which repo the commit was made by <github_username>

#### 2. Google Maps API Key

1. **Create a Google Cloud Account**:
- Go to [Google Cloud Console](https://console.cloud.google.com/)
- Create an account or sign in with your Google account

2. **Create a New Project**:
- In the cloud console, click on the project dropdown at the top
- Click "New Project"
- Name it (e.g., "CortexON Maps")
- Click "Create"

3. **Enable the Required APIs**:
- In your project, go to "APIs & Services" → "Library"
- Search for and enable these APIs:
* Maps JavaScript API
* Geocoding API
* Directions API
* Places API
* Distance Matrix API
- You can enable more APIs as per your requirements

4. **Create an API Key**:
- Go to "APIs & Services" → "Credentials"
- Click "Create Credentials" → "API Key"
- Your new API key will be displayed

5. **Add the API Key to Your Configuration**:
- Open `cortex_on/config/external_mcp_servers.json`
- Find the Google Maps section and replace the empty key:
```json
"env": {
"GOOGLE_MAPS_API_KEY": "<your-api-key-here>"
}
```
6. **Sample Queries**
- Find the closest pizza shops to \[address] within a 5-mile radius
- Find the shortest driving route that includes the following stops: \[address 1], \[address 2], and \[address 3]

---

### Docker Setup

1. Clone the CortexON repository:
Expand Down
13 changes: 13 additions & 0 deletions cortex_on/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ RUN apt-get update && apt-get install -y \
build-essential \
cmake \
g++ \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install Node.js and npm
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*

RUN export PYTHONPATH=/app
Expand All @@ -18,6 +24,13 @@ RUN uv pip install --system --no-cache-dir -r requirements.txt

COPY . .

# Set environment variables
ENV PYTHONPATH=/app
ENV ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
ENV ANTHROPIC_MODEL_NAME=${ANTHROPIC_MODEL_NAME:-claude-3-sonnet-20240229}

EXPOSE 8081
EXPOSE 3001

# Run only the main API - MCP server will be started programmatically
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8081"]
3 changes: 3 additions & 0 deletions cortex_on/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
- configure `.env` (using example `.env.copy`)
- either run `python -m src.main` in root folder
- or run `uvicorn --reload --access-log --host 0.0.0.0 --port 8001 src.main:app` to use with frontend



7 changes: 5 additions & 2 deletions cortex_on/agents/code_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pydantic import BaseModel, Field
from pydantic_ai import Agent, RunContext
from pydantic_ai.models.anthropic import AnthropicModel
from pydantic_ai.providers.anthropic import AnthropicProvider

# Local application imports
from utils.ant_client import get_client
Expand Down Expand Up @@ -236,10 +237,12 @@ async def send_stream_update(ctx: RunContext[CoderAgentDeps], message: str) -> N
stream_output_json = json.dumps(asdict(ctx.deps.stream_output))
logfire.debug("WebSocket message sent: {stream_output_json}", stream_output_json=stream_output_json)

# Initialize the model
# Initialize Anthropic provider with API key
provider = AnthropicProvider(api_key=os.environ.get("ANTHROPIC_API_KEY"))

model = AnthropicModel(
model_name=os.environ.get("ANTHROPIC_MODEL_NAME"),
anthropic_client=get_client()
provider=provider
)

# Initialize the agent
Expand Down
Loading