-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
24
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
24 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 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,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
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/dark/tool_neuron/database/dao/McpServerDao.kt
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,42 @@ | ||
| package com.dark.tool_neuron.database.dao | ||
|
|
||
| import androidx.room.* | ||
| import com.dark.tool_neuron.models.table_schema.McpServer | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| @Dao | ||
| interface McpServerDao { | ||
|
|
||
| @Query("SELECT * FROM mcp_servers ORDER BY name ASC") | ||
| fun getAllServers(): Flow<List<McpServer>> | ||
|
|
||
| @Query("SELECT * FROM mcp_servers WHERE isEnabled = 1 ORDER BY name ASC") | ||
| fun getEnabledServers(): Flow<List<McpServer>> | ||
|
|
||
| @Query("SELECT * FROM mcp_servers WHERE id = :id") | ||
| suspend fun getServerById(id: String): McpServer? | ||
|
|
||
| @Insert(onConflict = OnConflictStrategy.REPLACE) | ||
| suspend fun insertServer(server: McpServer) | ||
|
|
||
| @Update | ||
| suspend fun updateServer(server: McpServer) | ||
|
|
||
| @Delete | ||
| suspend fun deleteServer(server: McpServer) | ||
|
|
||
| @Query("DELETE FROM mcp_servers WHERE id = :id") | ||
| suspend fun deleteServerById(id: String) | ||
|
|
||
| @Query("UPDATE mcp_servers SET isEnabled = :isEnabled, updatedAt = :updatedAt WHERE id = :id") | ||
| suspend fun updateServerEnabled(id: String, isEnabled: Boolean, updatedAt: Long) | ||
|
|
||
| @Query("UPDATE mcp_servers SET lastConnectedAt = :timestamp, updatedAt = :updatedAt WHERE id = :id") | ||
| suspend fun updateLastConnected(id: String, timestamp: Long, updatedAt: Long) | ||
|
|
||
| @Query("SELECT COUNT(*) FROM mcp_servers") | ||
| fun getServerCount(): Flow<Int> | ||
|
|
||
| @Query("SELECT COUNT(*) FROM mcp_servers WHERE isEnabled = 1") | ||
| fun getEnabledServerCount(): Flow<Int> | ||
| } |
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
69 changes: 69 additions & 0 deletions
69
app/src/main/java/com/dark/tool_neuron/models/table_schema/McpServer.kt
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,69 @@ | ||
| package com.dark.tool_neuron.models.table_schema | ||
|
|
||
| import androidx.room.Entity | ||
| import androidx.room.PrimaryKey | ||
|
|
||
| /** | ||
| * Transport type for MCP server connections | ||
| */ | ||
| enum class McpTransportType { | ||
| SSE, // Server-Sent Events (HTTP) | ||
| STREAMABLE_HTTP // Streamable HTTP transport | ||
| } | ||
|
|
||
| /** | ||
| * Connection status of an MCP server (runtime only, not persisted) | ||
| */ | ||
| enum class McpConnectionStatus { | ||
| DISCONNECTED, | ||
| CONNECTING, | ||
| CONNECTED, | ||
| ERROR | ||
| } | ||
|
|
||
| /** | ||
| * Entity representing a remote MCP (Model Context Protocol) server configuration. | ||
| * MCP servers provide tools, resources, and prompts to LLM applications. | ||
| */ | ||
| @Entity(tableName = "mcp_servers") | ||
| data class McpServer( | ||
| @PrimaryKey | ||
| val id: String, | ||
|
|
||
| /** Display name for the server */ | ||
| val name: String, | ||
|
|
||
| /** Server URL (e.g., "https://api.example.com/mcp") */ | ||
| val url: String, | ||
|
|
||
| /** Transport type for the connection */ | ||
| val transportType: McpTransportType = McpTransportType.SSE, | ||
|
|
||
| /** Optional API key for authentication */ | ||
| val apiKey: String? = null, | ||
|
|
||
| /** Whether the server is enabled */ | ||
| val isEnabled: Boolean = true, | ||
|
|
||
| /** Last error message if connection failed */ | ||
| val lastError: String? = null, | ||
|
|
||
| /** Timestamp when the server was added */ | ||
| val createdAt: Long = System.currentTimeMillis(), | ||
|
|
||
| /** Timestamp when the server was last modified */ | ||
| val updatedAt: Long = System.currentTimeMillis(), | ||
|
|
||
| /** Timestamp when last successfully connected */ | ||
| val lastConnectedAt: Long? = null, | ||
|
|
||
| /** Optional description */ | ||
| val description: String = "", | ||
|
|
||
| /** Custom headers as JSON string (e.g., for additional auth) */ | ||
| val customHeadersJson: String? = null | ||
| ) { | ||
| companion object { | ||
| fun generateId(): String = java.util.UUID.randomUUID().toString() | ||
| } | ||
| } |
Oops, something went wrong.
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.