mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
refactor(mcp): standard mcpServers input format with type inference
- Accept standard mcpServers item format (command/args/env/url/headers) - Auto-infer connection type: command -> stdio, url -> http/sse - Add PUT /bots/:bot_id/mcp/import for batch import from mcpServers dict - Add GET /bots/:bot_id/mcp/export for standard format export - Add UpsertMCPConnectionByName SQL for import upsert by name - Preserve is_active state on import upsert
This commit is contained in:
@@ -28,3 +28,12 @@ RETURNING id, bot_id, name, type, config, is_active, created_at, updated_at;
|
||||
-- name: DeleteMCPConnection :exec
|
||||
DELETE FROM mcp_connections
|
||||
WHERE bot_id = $1 AND id = $2;
|
||||
|
||||
-- name: UpsertMCPConnectionByName :one
|
||||
INSERT INTO mcp_connections (bot_id, name, type, config)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
ON CONFLICT (bot_id, name)
|
||||
DO UPDATE SET type = EXCLUDED.type,
|
||||
config = EXCLUDED.config,
|
||||
updated_at = now()
|
||||
RETURNING id, bot_id, name, type, config, is_active, created_at, updated_at;
|
||||
|
||||
Reference in New Issue
Block a user