-
-
Notifications
You must be signed in to change notification settings - Fork 18
Add remote mcp support #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Godzilla675
wants to merge
27
commits into
Siddhesh2377:re-write
Choose a base branch
from
Godzilla675:re-write
base: re-write
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5e021e0
Initial plan
Copilot 385de84
Add Remote MCP Server support with UI
Copilot f537004
Address code review feedback - fix hardcoded values and security impr…
Copilot 2281975
Fix DAO default parameters and explicit timestamp passing
Copilot f0651a2
Fix MCP SSE support for Zapier MCP servers and build errors
Copilot 4996618
Improve SSE parsing to correctly handle event format per SSE spec
Copilot df94f6e
Add proper Streamable HTTP transport support alongside SSE
Copilot a360b6b
Fix code review comments on transport documentation
Copilot 669318b
Address code review feedback and add GitHub workflow for debug APK
Copilot 34b3dba
Fix race condition in error auto-clearing
Copilot 5f3ea4c
Merge pull request #1 from Godzilla675/copilot/add-remote-mcp-server-…
Godzilla675 aac348a
Merge branch 'Siddhesh2377:re-write' into re-write
Godzilla675 dd31ae5
Initial plan
Copilot da0af0c
Enable BuildConfig for memory-vault
Copilot 18aea53
Merge pull request #2 from Godzilla675/copilot/fix-debug-workflow-build
Godzilla675 c2e79bf
Initial plan
Copilot 148d979
Integrate MCP tools with GGUF
Copilot 89dde9b
Refine MCP tool call execution
Copilot 524d6eb
Merge pull request #3 from Godzilla675/copilot/test-ai-models-access
Godzilla675 03cfc52
Initial plan
Copilot d8692ff
Add MCP server integration tests
Copilot 8872229
Fix MCP integration test input schemas to include required instructio…
Copilot cdb24df
Fix Streamable HTTP transport and improve MCP server tests
Copilot a87425a
Merge pull request #5 from Godzilla675/copilot/connect-ai-model-to-mc…
Godzilla675 dd3e72c
Fix MCP tool calling bugs: sanitizer, fallback parsing, error handling
Godzilla675 19e5004
feat: Add MCP Store and Termux integration
Godzilla675 0e3c723
Merge upstream re-write: resolve conflicts, integrate MCP with Plugin…
Godzilla675 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Copilot Instructions for ToolNeuron | ||
|
|
||
| ## Build & Test | ||
|
|
||
| ```bash | ||
| # Build debug APK | ||
| ./gradlew assembleDebug | ||
|
|
||
| # Build release APK (requires signing config in local.properties) | ||
| ./gradlew assembleRelease | ||
|
|
||
| # Run all unit tests | ||
| ./gradlew test | ||
|
|
||
| # Run tests for a single module | ||
| ./gradlew :app:test | ||
| ./gradlew :memory-vault:test | ||
| ./gradlew :neuron-packet:test | ||
|
|
||
| # Run a single test class | ||
| ./gradlew :app:testDebugUnitTest --tests "com.dark.tool_neuron.McpToolMapperTest" | ||
| ``` | ||
|
|
||
| **Requirements:** JDK 17, Android SDK 36, NDK 26.x. The `neuron-packet` module requires OpenSSL prebuilt libraries — see `neuron-packet/SETUP.md`. | ||
|
|
||
| ## Architecture | ||
|
|
||
| This is an Android app (Kotlin + C++) that runs LLMs and Stable Diffusion entirely on-device. It's a multi-module Gradle project: | ||
|
|
||
| - **`app`** — Main application. Jetpack Compose UI, MVVM with Hilt DI, Room database. Package: `com.dark.tool_neuron`. | ||
| - **`memory-vault`** — Encrypted binary storage engine with WAL crash recovery, LZ4 compression, full-text and vector indices. Package: `com.memoryvault`. See `docs/MemoryVault.MD` for the storage format spec. | ||
| - **`neuron-packet`** — Secure data export/import with AES-256-GCM encryption. Has both Kotlin and C++ (JNI) sides. Package: `com.neuronpacket`. The C++ code lives in `neuron-packet/src/main/cpp/` and builds via CMake. | ||
|
|
||
| ### AI inference layer | ||
|
|
||
| Native inference is provided by pre-built AAR libraries in `libs/`: | ||
| - `ai_gguf-release.aar` — llama.cpp bindings for text generation (GGUF models) | ||
| - `ai_sd-release.aar` — Stable Diffusion 1.5 bindings for image generation | ||
|
|
||
| These are wrapped by engine classes in `app/.../engine/`: | ||
| - `GGUFEngine` — loads GGUF models, generates text, supports function calling with tool grammars | ||
| - `DiffusionEngine` — loads SD models, generates images | ||
| - `EmbeddingEngine` — generates text embeddings for RAG/vector search | ||
|
|
||
| `LLMService` is a bound Android Service that exposes these engines via AIDL IPC. | ||
|
|
||
| ### Data flow | ||
|
|
||
| `UI (Compose screens)` → `ViewModel (@HiltViewModel)` → `Repository` → `Room DAO / MemoryVault` | ||
|
|
||
| ViewModels expose `StateFlow` for reactive UI updates. All async work uses Kotlin Coroutines with `viewModelScope`. | ||
|
|
||
| ## Key Conventions | ||
|
|
||
| - **DI:** Hilt everywhere. Activities use `@AndroidEntryPoint`, ViewModels use `@HiltViewModel`. All modules are defined in `app/.../di/HiltModules.kt` and installed in `SingletonComponent`. | ||
| - **Navigation:** Jetpack Compose NavHost in `MainActivity`. Routes are defined as a `Screen` sealed class. Uses slide + fade transitions. | ||
| - **Serialization:** `kotlinx.serialization` for JSON. Room entities live in `models/table_schema/`. | ||
| - **NDK targets:** `arm64-v8a` and `x86_64` only. | ||
| - **Build config:** Properties are read from `local.properties` or environment variables via `getProperty()` (defined in each module's `build.gradle.kts`). The `ALIAS` property is used for build config fields. | ||
| - **UI constants:** Shared sizing/padding values are in `global/Standards.kt`. | ||
| - **Version catalog:** All dependency versions are managed in `gradle/libs.versions.toml`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Build Debug APK | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main, master ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build Debug APK | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: gradle | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build Debug APK | ||
| run: ./gradlew assembleDebug --no-daemon | ||
|
|
||
| - name: Upload Debug APK | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: app-debug | ||
| path: app/build/outputs/apk/debug/app-debug.apk | ||
| retention-days: 14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| [ | ||
| { | ||
| "id": "brave-search", | ||
| "name": "Brave Search", | ||
| "description": "Web search using the Brave Search API. Provides real-time web results, news, and more.", | ||
| "url": "https://mcp.brave.com/sse", | ||
| "transportType": "SSE", | ||
| "category": "Search", | ||
| "requiresApiKey": true, | ||
| "requiresTermux": false, | ||
| "author": "Brave Software", | ||
| "tags": ["search", "web", "news"], | ||
| "iconName": "Search", | ||
| "setupInstructions": "Get a free API key at https://brave.com/search/api/" | ||
| }, | ||
| { | ||
| "id": "github-mcp", | ||
| "name": "GitHub", | ||
| "description": "Access GitHub repositories, issues, PRs, and code search via the GitHub API.", | ||
| "url": "https://api.githubcopilot.com/mcp/", | ||
| "transportType": "STREAMABLE_HTTP", | ||
| "category": "Code", | ||
| "requiresApiKey": true, | ||
| "requiresTermux": false, | ||
| "author": "GitHub", | ||
| "tags": ["github", "code", "repositories", "issues"], | ||
| "iconName": "Code", | ||
| "setupInstructions": "Use a GitHub Personal Access Token (PAT) with appropriate scopes." | ||
| }, | ||
| { | ||
| "id": "fetch-mcp", | ||
| "name": "Fetch", | ||
| "description": "Fetch and parse web pages. Converts HTML to markdown for LLM consumption.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Utilities", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-fetch", | ||
| "defaultPort": 8100, | ||
| "author": "Anthropic", | ||
| "tags": ["web", "fetch", "scraping", "markdown"], | ||
| "iconName": "Language", | ||
| "setupInstructions": "Requires Termux with Python installed. Will auto-install via pip." | ||
| }, | ||
| { | ||
| "id": "filesystem-mcp", | ||
| "name": "Filesystem", | ||
| "description": "Read, write, and manage files on the device. Sandboxed to a configurable directory.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Files", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-filesystem", | ||
| "defaultPort": 8101, | ||
| "author": "Anthropic", | ||
| "tags": ["files", "filesystem", "read", "write"], | ||
| "iconName": "Folder", | ||
| "setupInstructions": "Requires Termux with Python installed. Files will be sandboxed to Termux home directory." | ||
| }, | ||
| { | ||
| "id": "sqlite-mcp", | ||
| "name": "SQLite", | ||
| "description": "Query and manage SQLite databases. Execute SQL statements and explore schemas.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Data", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-sqlite", | ||
| "defaultPort": 8102, | ||
| "author": "Anthropic", | ||
| "tags": ["database", "sql", "sqlite", "query"], | ||
| "iconName": "Storage", | ||
| "setupInstructions": "Requires Termux with Python installed. Specify database path after installation." | ||
| }, | ||
| { | ||
| "id": "memory-mcp", | ||
| "name": "Memory", | ||
| "description": "Persistent key-value memory for the AI. Stores and retrieves information across conversations.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "AI", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-memory", | ||
| "defaultPort": 8103, | ||
| "author": "Anthropic", | ||
| "tags": ["memory", "persistence", "knowledge"], | ||
| "iconName": "Psychology", | ||
| "setupInstructions": "Requires Termux with Python installed. Memory is stored locally." | ||
| }, | ||
| { | ||
| "id": "everything-mcp", | ||
| "name": "Everything", | ||
| "description": "Reference MCP server with examples of all MCP features. Great for testing your setup.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Utilities", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-everything", | ||
| "defaultPort": 8104, | ||
| "author": "Anthropic", | ||
| "tags": ["testing", "reference", "demo"], | ||
| "iconName": "Science", | ||
| "setupInstructions": "Requires Termux with Python installed. A demo server for testing." | ||
| }, | ||
| { | ||
| "id": "duckduckgo-mcp", | ||
| "name": "DuckDuckGo Search", | ||
| "description": "Free web search using DuckDuckGo. No API key required.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Search", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-duckduckgo", | ||
| "defaultPort": 8105, | ||
| "author": "Community", | ||
| "tags": ["search", "web", "free", "privacy"], | ||
| "iconName": "Search", | ||
| "setupInstructions": "Requires Termux with Python installed. Free search with no API key needed." | ||
| }, | ||
| { | ||
| "id": "youtube-mcp", | ||
| "name": "YouTube Transcript", | ||
| "description": "Fetch YouTube video transcripts and captions for LLM analysis.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Data", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": true, | ||
| "pipPackage": "mcp-server-youtube-transcript", | ||
| "defaultPort": 8106, | ||
| "author": "Community", | ||
| "tags": ["youtube", "transcript", "video", "captions"], | ||
| "iconName": "OndemandVideo", | ||
| "setupInstructions": "Requires Termux with Python installed. Fetches transcripts from public YouTube videos." | ||
| }, | ||
| { | ||
| "id": "custom-remote", | ||
| "name": "Custom Remote Server", | ||
| "description": "Connect to any remote MCP server by providing its URL. Supports SSE and Streamable HTTP.", | ||
| "url": "", | ||
| "transportType": "SSE", | ||
| "category": "Utilities", | ||
| "requiresApiKey": false, | ||
| "requiresTermux": false, | ||
| "author": "ToolNeuron", | ||
| "tags": ["custom", "remote", "self-hosted"], | ||
| "iconName": "Cloud", | ||
| "setupInstructions": "Enter the URL of your MCP server. It should support SSE or Streamable HTTP transport." | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The org.json dependency is being added for testing, but this library is already included in the Android SDK. This creates redundant dependencies and potential version conflicts. Consider removing this dependency since org.json is available by default in Android.