@commandable/mcp 0.0.1
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.
- package/LICENSE +10 -0
- package/README.md +34 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +7 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/credentialManager.d.ts +19 -0
- package/dist/cli/credentialManager.d.ts.map +1 -0
- package/dist/cli/credentialManager.js +81 -0
- package/dist/cli/credentialManager.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +77 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +194 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/crypto/encryption.d.ts +3 -0
- package/dist/crypto/encryption.d.ts.map +1 -0
- package/dist/crypto/encryption.js +29 -0
- package/dist/crypto/encryption.js.map +1 -0
- package/dist/db/client.d.ts +22 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +43 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/credentialStore.d.ts +13 -0
- package/dist/db/credentialStore.d.ts.map +1 -0
- package/dist/db/credentialStore.js +57 -0
- package/dist/db/credentialStore.js.map +1 -0
- package/dist/db/integrationStore.d.ts +5 -0
- package/dist/db/integrationStore.d.ts.map +1 -0
- package/dist/db/integrationStore.js +65 -0
- package/dist/db/integrationStore.js.map +1 -0
- package/dist/db/migrate.d.ts +3 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +88 -0
- package/dist/db/migrate.js.map +1 -0
- package/dist/db/schema.d.ts +911 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +73 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/errors/httpError.d.ts +6 -0
- package/dist/errors/httpError.d.ts.map +1 -0
- package/dist/errors/httpError.js +11 -0
- package/dist/errors/httpError.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/actionsFactory.d.ts +12 -0
- package/dist/integrations/actionsFactory.d.ts.map +1 -0
- package/dist/integrations/actionsFactory.js +68 -0
- package/dist/integrations/actionsFactory.js.map +1 -0
- package/dist/integrations/catalog.d.ts +9 -0
- package/dist/integrations/catalog.d.ts.map +1 -0
- package/dist/integrations/catalog.js +80 -0
- package/dist/integrations/catalog.js.map +1 -0
- package/dist/integrations/dataLoader.d.ts +47 -0
- package/dist/integrations/dataLoader.d.ts.map +1 -0
- package/dist/integrations/dataLoader.js +126 -0
- package/dist/integrations/dataLoader.js.map +1 -0
- package/dist/integrations/getIntegration.d.ts +11 -0
- package/dist/integrations/getIntegration.d.ts.map +1 -0
- package/dist/integrations/getIntegration.js +22 -0
- package/dist/integrations/getIntegration.js.map +1 -0
- package/dist/integrations/googleServiceAccount.d.ts +6 -0
- package/dist/integrations/googleServiceAccount.d.ts.map +1 -0
- package/dist/integrations/googleServiceAccount.js +54 -0
- package/dist/integrations/googleServiceAccount.js.map +1 -0
- package/dist/integrations/providerRegistry.d.ts +2 -0
- package/dist/integrations/providerRegistry.d.ts.map +1 -0
- package/dist/integrations/providerRegistry.js +50 -0
- package/dist/integrations/providerRegistry.js.map +1 -0
- package/dist/integrations/proxy.d.ts +16 -0
- package/dist/integrations/proxy.d.ts.map +1 -0
- package/dist/integrations/proxy.js +331 -0
- package/dist/integrations/proxy.js.map +1 -0
- package/dist/integrations/sandbox.d.ts +7 -0
- package/dist/integrations/sandbox.d.ts.map +1 -0
- package/dist/integrations/sandbox.js +210 -0
- package/dist/integrations/sandbox.js.map +1 -0
- package/dist/integrations/tools.d.ts +3 -0
- package/dist/integrations/tools.d.ts.map +1 -0
- package/dist/integrations/tools.js +70 -0
- package/dist/integrations/tools.js.map +1 -0
- package/dist/mcp/server.d.ts +15 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +50 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/toolAdapter.d.ts +17 -0
- package/dist/mcp/toolAdapter.d.ts.map +1 -0
- package/dist/mcp/toolAdapter.js +18 -0
- package/dist/mcp/toolAdapter.js.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/integration-data/README.md +52 -0
- package/integration-data/airtable/credentials.json +20 -0
- package/integration-data/airtable/credentials_hint.md +4 -0
- package/integration-data/airtable/handlers/create_record.js +12 -0
- package/integration-data/airtable/handlers/delete_record.js +7 -0
- package/integration-data/airtable/handlers/get_record.js +4 -0
- package/integration-data/airtable/handlers/get_table_schema.js +6 -0
- package/integration-data/airtable/handlers/list_bases.js +4 -0
- package/integration-data/airtable/handlers/list_records.js +25 -0
- package/integration-data/airtable/handlers/list_table_fields.js +6 -0
- package/integration-data/airtable/handlers/list_tables.js +4 -0
- package/integration-data/airtable/handlers/list_views.js +6 -0
- package/integration-data/airtable/handlers/search_records.js +6 -0
- package/integration-data/airtable/handlers/update_record.js +11 -0
- package/integration-data/airtable/manifest.json +83 -0
- package/integration-data/airtable/schemas/create_record.json +12 -0
- package/integration-data/airtable/schemas/delete_record.json +11 -0
- package/integration-data/airtable/schemas/empty.json +6 -0
- package/integration-data/airtable/schemas/get_record.json +11 -0
- package/integration-data/airtable/schemas/id_base.json +9 -0
- package/integration-data/airtable/schemas/id_base_table.json +10 -0
- package/integration-data/airtable/schemas/list_records.json +26 -0
- package/integration-data/airtable/schemas/search_records.json +12 -0
- package/integration-data/airtable/schemas/update_record.json +13 -0
- package/integration-data/github/credentials.json +20 -0
- package/integration-data/github/credentials_hint.md +7 -0
- package/integration-data/github/handlers/add_labels_to_issue.js +12 -0
- package/integration-data/github/handlers/close_issue.js +5 -0
- package/integration-data/github/handlers/comment_on_issue.js +5 -0
- package/integration-data/github/handlers/create_branch.js +33 -0
- package/integration-data/github/handlers/create_commit.js +91 -0
- package/integration-data/github/handlers/create_issue.js +10 -0
- package/integration-data/github/handlers/create_or_update_file.js +21 -0
- package/integration-data/github/handlers/create_pull_request.js +16 -0
- package/integration-data/github/handlers/create_repo.js +11 -0
- package/integration-data/github/handlers/delete_repo.js +6 -0
- package/integration-data/github/handlers/get_issue.js +4 -0
- package/integration-data/github/handlers/get_repo.js +4 -0
- package/integration-data/github/handlers/list_branches.js +4 -0
- package/integration-data/github/handlers/list_commits.js +12 -0
- package/integration-data/github/handlers/list_issues.js +12 -0
- package/integration-data/github/handlers/list_pull_requests.js +8 -0
- package/integration-data/github/handlers/list_repos_install.js +4 -0
- package/integration-data/github/handlers/list_repos_user.js +4 -0
- package/integration-data/github/handlers/merge_pull_request.js +14 -0
- package/integration-data/github/handlers/update_issue.js +15 -0
- package/integration-data/github/manifest.json +26 -0
- package/integration-data/github/schemas/add_labels_to_issue.json +12 -0
- package/integration-data/github/schemas/close_issue.json +10 -0
- package/integration-data/github/schemas/comment_on_issue.json +11 -0
- package/integration-data/github/schemas/create_branch.json +12 -0
- package/integration-data/github/schemas/create_commit.json +25 -0
- package/integration-data/github/schemas/create_issue.json +13 -0
- package/integration-data/github/schemas/create_or_update_file.json +15 -0
- package/integration-data/github/schemas/create_pull_request.json +15 -0
- package/integration-data/github/schemas/create_repo.json +12 -0
- package/integration-data/github/schemas/delete_repo.json +10 -0
- package/integration-data/github/schemas/empty.json +5 -0
- package/integration-data/github/schemas/get_issue.json +10 -0
- package/integration-data/github/schemas/get_repo.json +9 -0
- package/integration-data/github/schemas/list_commits.json +12 -0
- package/integration-data/github/schemas/list_issues.json +12 -0
- package/integration-data/github/schemas/list_pull_requests.json +10 -0
- package/integration-data/github/schemas/merge_pull_request.json +14 -0
- package/integration-data/github/schemas/owner_repo.json +9 -0
- package/integration-data/github/schemas/update_issue.json +15 -0
- package/integration-data/google-calendar/credentials.json +36 -0
- package/integration-data/google-calendar/credentials_hint.md +9 -0
- package/integration-data/google-calendar/handlers/create_event.js +6 -0
- package/integration-data/google-calendar/handlers/delete_acl.js +6 -0
- package/integration-data/google-calendar/handlers/delete_event.js +7 -0
- package/integration-data/google-calendar/handlers/freebusy_query.js +4 -0
- package/integration-data/google-calendar/handlers/get_acl.js +5 -0
- package/integration-data/google-calendar/handlers/get_calendar.js +4 -0
- package/integration-data/google-calendar/handlers/get_event.js +5 -0
- package/integration-data/google-calendar/handlers/insert_acl.js +6 -0
- package/integration-data/google-calendar/handlers/list_acl.js +5 -0
- package/integration-data/google-calendar/handlers/list_calendars.js +4 -0
- package/integration-data/google-calendar/handlers/list_colors.js +4 -0
- package/integration-data/google-calendar/handlers/list_events.js +21 -0
- package/integration-data/google-calendar/handlers/list_settings.js +4 -0
- package/integration-data/google-calendar/handlers/move_event.js +6 -0
- package/integration-data/google-calendar/handlers/patch_event.js +5 -0
- package/integration-data/google-calendar/handlers/quick_add.js +6 -0
- package/integration-data/google-calendar/handlers/update_acl.js +7 -0
- package/integration-data/google-calendar/handlers/update_event.js +5 -0
- package/integration-data/google-calendar/manifest.json +26 -0
- package/integration-data/google-calendar/schemas/create_event.json +34 -0
- package/integration-data/google-calendar/schemas/delete_acl.json +9 -0
- package/integration-data/google-calendar/schemas/empty.json +1 -0
- package/integration-data/google-calendar/schemas/freebusy_query.json +13 -0
- package/integration-data/google-calendar/schemas/get_acl.json +9 -0
- package/integration-data/google-calendar/schemas/id_calendar.json +8 -0
- package/integration-data/google-calendar/schemas/id_calendar_event.json +9 -0
- package/integration-data/google-calendar/schemas/insert_acl.json +18 -0
- package/integration-data/google-calendar/schemas/list_events.json +15 -0
- package/integration-data/google-calendar/schemas/move_event.json +10 -0
- package/integration-data/google-calendar/schemas/patch_event.json +10 -0
- package/integration-data/google-calendar/schemas/quick_add.json +9 -0
- package/integration-data/google-calendar/schemas/update_acl.json +10 -0
- package/integration-data/google-calendar/schemas/update_event.json +10 -0
- package/integration-data/google-docs/credentials.json +36 -0
- package/integration-data/google-docs/credentials_hint.md +9 -0
- package/integration-data/google-docs/handlers/append_text.js +12 -0
- package/integration-data/google-docs/handlers/batch_update.js +13 -0
- package/integration-data/google-docs/handlers/create_document.js +9 -0
- package/integration-data/google-docs/handlers/delete_first_match.js +50 -0
- package/integration-data/google-docs/handlers/get_document.js +12 -0
- package/integration-data/google-docs/handlers/get_document_structured.js +6 -0
- package/integration-data/google-docs/handlers/get_document_text.js +17 -0
- package/integration-data/google-docs/handlers/insert_inline_image_after_first_match.js +41 -0
- package/integration-data/google-docs/handlers/insert_page_break_after_first_match.js +49 -0
- package/integration-data/google-docs/handlers/insert_table_after_first_match.js +49 -0
- package/integration-data/google-docs/handlers/insert_text_after_first_match.js +51 -0
- package/integration-data/google-docs/handlers/replace_all_text.js +8 -0
- package/integration-data/google-docs/handlers/style_first_match.js +42 -0
- package/integration-data/google-docs/handlers/update_document_style.js +8 -0
- package/integration-data/google-docs/handlers/update_paragraph_style_for_first_match.js +48 -0
- package/integration-data/google-docs/manifest.json +58 -0
- package/integration-data/google-docs/schemas/append_text.json +10 -0
- package/integration-data/google-docs/schemas/apply_text_style.json +13 -0
- package/integration-data/google-docs/schemas/batch_update.json +16 -0
- package/integration-data/google-docs/schemas/create_document.json +8 -0
- package/integration-data/google-docs/schemas/delete_content_range.json +11 -0
- package/integration-data/google-docs/schemas/delete_first_match.json +10 -0
- package/integration-data/google-docs/schemas/get_document.json +11 -0
- package/integration-data/google-docs/schemas/get_document_structured.json +9 -0
- package/integration-data/google-docs/schemas/get_document_text.json +9 -0
- package/integration-data/google-docs/schemas/insert_inline_image.json +12 -0
- package/integration-data/google-docs/schemas/insert_inline_image_after_first_match.json +13 -0
- package/integration-data/google-docs/schemas/insert_page_break.json +10 -0
- package/integration-data/google-docs/schemas/insert_page_break_after_first_match.json +11 -0
- package/integration-data/google-docs/schemas/insert_table.json +12 -0
- package/integration-data/google-docs/schemas/insert_table_after_first_match.json +13 -0
- package/integration-data/google-docs/schemas/insert_text_after_first_match.json +12 -0
- package/integration-data/google-docs/schemas/insert_text_at.json +11 -0
- package/integration-data/google-docs/schemas/replace_all_text.json +12 -0
- package/integration-data/google-docs/schemas/style_first_match.json +12 -0
- package/integration-data/google-docs/schemas/update_document_style.json +11 -0
- package/integration-data/google-docs/schemas/update_paragraph_style.json +13 -0
- package/integration-data/google-docs/schemas/update_paragraph_style_for_first_match.json +12 -0
- package/integration-data/google-sheet/credentials.json +36 -0
- package/integration-data/google-sheet/credentials_hint.md +9 -0
- package/integration-data/google-sheet/handlers/append_values.js +18 -0
- package/integration-data/google-sheet/handlers/batch_clear_values.js +6 -0
- package/integration-data/google-sheet/handlers/batch_clear_values_by_data_filter.js +6 -0
- package/integration-data/google-sheet/handlers/batch_get_values.js +16 -0
- package/integration-data/google-sheet/handlers/batch_update.js +14 -0
- package/integration-data/google-sheet/handlers/batch_update_values.js +16 -0
- package/integration-data/google-sheet/handlers/batch_update_values_by_data_filter.js +16 -0
- package/integration-data/google-sheet/handlers/clear_values.js +6 -0
- package/integration-data/google-sheet/handlers/copy_to_spreadsheet.js +6 -0
- package/integration-data/google-sheet/handlers/create_spreadsheet.js +5 -0
- package/integration-data/google-sheet/handlers/get_developer_metadata.js +6 -0
- package/integration-data/google-sheet/handlers/get_spreadsheet.js +12 -0
- package/integration-data/google-sheet/handlers/get_spreadsheet_by_data_filter.js +10 -0
- package/integration-data/google-sheet/handlers/get_values.js +14 -0
- package/integration-data/google-sheet/handlers/get_values_by_data_filter.js +14 -0
- package/integration-data/google-sheet/handlers/search_developer_metadata.js +7 -0
- package/integration-data/google-sheet/handlers/update_values.js +16 -0
- package/integration-data/google-sheet/manifest.json +125 -0
- package/integration-data/google-sheet/schemas/append_values.json +16 -0
- package/integration-data/google-sheet/schemas/batch_clear_values.json +10 -0
- package/integration-data/google-sheet/schemas/batch_clear_values_by_data_filter.json +10 -0
- package/integration-data/google-sheet/schemas/batch_get_values.json +13 -0
- package/integration-data/google-sheet/schemas/batch_update.json +13 -0
- package/integration-data/google-sheet/schemas/batch_update_values.json +25 -0
- package/integration-data/google-sheet/schemas/batch_update_values_by_data_filter.json +25 -0
- package/integration-data/google-sheet/schemas/clear_values.json +10 -0
- package/integration-data/google-sheet/schemas/copy_to_spreadsheet.json +11 -0
- package/integration-data/google-sheet/schemas/create_spreadsheet.json +11 -0
- package/integration-data/google-sheet/schemas/get_developer_metadata.json +10 -0
- package/integration-data/google-sheet/schemas/get_spreadsheet.json +15 -0
- package/integration-data/google-sheet/schemas/get_spreadsheet_by_data_filter.json +11 -0
- package/integration-data/google-sheet/schemas/get_values.json +13 -0
- package/integration-data/google-sheet/schemas/get_values_by_data_filter.json +17 -0
- package/integration-data/google-sheet/schemas/search_developer_metadata.json +14 -0
- package/integration-data/google-sheet/schemas/update_values.json +15 -0
- package/integration-data/google-slides/credentials.json +36 -0
- package/integration-data/google-slides/credentials_hint.md +9 -0
- package/integration-data/google-slides/handlers/append_text_to_title_of_first_slide.js +17 -0
- package/integration-data/google-slides/handlers/batch_update.js +15 -0
- package/integration-data/google-slides/handlers/create_presentation.js +8 -0
- package/integration-data/google-slides/handlers/create_slide_after_first_match.js +20 -0
- package/integration-data/google-slides/handlers/get_page_thumbnail.js +12 -0
- package/integration-data/google-slides/handlers/get_presentation.js +6 -0
- package/integration-data/google-slides/handlers/insert_image_after_first_match.js +19 -0
- package/integration-data/google-slides/handlers/insert_shape_after_first_match.js +21 -0
- package/integration-data/google-slides/handlers/replace_text_first_match.js +9 -0
- package/integration-data/google-slides/handlers/set_background_color_for_slide_index.js +15 -0
- package/integration-data/google-slides/handlers/style_text_first_match.js +48 -0
- package/integration-data/google-slides/manifest.json +41 -0
- package/integration-data/google-slides/schemas/append_text_to_title_of_first_slide.json +11 -0
- package/integration-data/google-slides/schemas/batch_update.json +13 -0
- package/integration-data/google-slides/schemas/create_presentation.json +8 -0
- package/integration-data/google-slides/schemas/create_slide_after_first_match.json +11 -0
- package/integration-data/google-slides/schemas/get_page_thumbnail.json +12 -0
- package/integration-data/google-slides/schemas/get_presentation.json +9 -0
- package/integration-data/google-slides/schemas/insert_image_after_first_match.json +13 -0
- package/integration-data/google-slides/schemas/insert_shape_after_first_match.json +13 -0
- package/integration-data/google-slides/schemas/replace_text_first_match.json +12 -0
- package/integration-data/google-slides/schemas/set_background_color_for_slide_index.json +11 -0
- package/integration-data/google-slides/schemas/style_text_first_match.json +12 -0
- package/integration-data/new_integration_prompt.md +41 -0
- package/integration-data/notion/credentials.json +21 -0
- package/integration-data/notion/credentials_hint.md +5 -0
- package/integration-data/notion/handlers/append_block_children.js +7 -0
- package/integration-data/notion/handlers/create_comment.js +10 -0
- package/integration-data/notion/handlers/create_database.js +11 -0
- package/integration-data/notion/handlers/create_page.js +13 -0
- package/integration-data/notion/handlers/delete_block.js +8 -0
- package/integration-data/notion/handlers/get_me.js +4 -0
- package/integration-data/notion/handlers/list_block_children.js +10 -0
- package/integration-data/notion/handlers/list_comments.js +14 -0
- package/integration-data/notion/handlers/list_users.js +10 -0
- package/integration-data/notion/handlers/query_database.js +10 -0
- package/integration-data/notion/handlers/retrieve_block.js +4 -0
- package/integration-data/notion/handlers/retrieve_database.js +4 -0
- package/integration-data/notion/handlers/retrieve_page.js +4 -0
- package/integration-data/notion/handlers/retrieve_page_property_item.js +10 -0
- package/integration-data/notion/handlers/retrieve_user.js +4 -0
- package/integration-data/notion/handlers/search.js +11 -0
- package/integration-data/notion/handlers/update_block.js +7 -0
- package/integration-data/notion/handlers/update_database.js +10 -0
- package/integration-data/notion/handlers/update_page_properties.js +10 -0
- package/integration-data/notion/manifest.json +139 -0
- package/integration-data/notion/prompt.md +26 -0
- package/integration-data/notion/schemas/append_block_children.json +10 -0
- package/integration-data/notion/schemas/create_comment.json +18 -0
- package/integration-data/notion/schemas/create_database.json +18 -0
- package/integration-data/notion/schemas/create_page.json +22 -0
- package/integration-data/notion/schemas/delete_block.json +9 -0
- package/integration-data/notion/schemas/empty.json +6 -0
- package/integration-data/notion/schemas/id_block.json +9 -0
- package/integration-data/notion/schemas/id_database.json +9 -0
- package/integration-data/notion/schemas/id_page.json +9 -0
- package/integration-data/notion/schemas/id_user.json +9 -0
- package/integration-data/notion/schemas/list_block_children.json +11 -0
- package/integration-data/notion/schemas/list_comments.json +15 -0
- package/integration-data/notion/schemas/list_users.json +9 -0
- package/integration-data/notion/schemas/query_database.json +13 -0
- package/integration-data/notion/schemas/retrieve_page_property_item.json +12 -0
- package/integration-data/notion/schemas/search.json +27 -0
- package/integration-data/notion/schemas/update_block.json +10 -0
- package/integration-data/notion/schemas/update_database.json +13 -0
- package/integration-data/notion/schemas/update_page_properties.json +13 -0
- package/integration-data/trello/credentials.json +26 -0
- package/integration-data/trello/credentials_hint.md +4 -0
- package/integration-data/trello/handlers/add_checklist_to_card.js +5 -0
- package/integration-data/trello/handlers/add_member_to_card.js +5 -0
- package/integration-data/trello/handlers/archive_list.js +5 -0
- package/integration-data/trello/handlers/create_card.js +13 -0
- package/integration-data/trello/handlers/create_list.js +7 -0
- package/integration-data/trello/handlers/delete_card.js +9 -0
- package/integration-data/trello/handlers/get_board.js +4 -0
- package/integration-data/trello/handlers/get_board_cards.js +4 -0
- package/integration-data/trello/handlers/get_board_custom_fields.js +4 -0
- package/integration-data/trello/handlers/get_board_labels.js +4 -0
- package/integration-data/trello/handlers/get_board_lists.js +4 -0
- package/integration-data/trello/handlers/get_board_members.js +4 -0
- package/integration-data/trello/handlers/get_board_memberships.js +4 -0
- package/integration-data/trello/handlers/get_card.js +4 -0
- package/integration-data/trello/handlers/get_card_actions.js +4 -0
- package/integration-data/trello/handlers/get_card_attachments.js +4 -0
- package/integration-data/trello/handlers/get_card_checklists.js +4 -0
- package/integration-data/trello/handlers/get_card_custom_field_items.js +4 -0
- package/integration-data/trello/handlers/get_card_members.js +4 -0
- package/integration-data/trello/handlers/get_list.js +4 -0
- package/integration-data/trello/handlers/get_list_cards.js +4 -0
- package/integration-data/trello/handlers/get_member.js +4 -0
- package/integration-data/trello/handlers/get_member_boards.js +4 -0
- package/integration-data/trello/handlers/get_member_organizations.js +4 -0
- package/integration-data/trello/handlers/get_organization.js +4 -0
- package/integration-data/trello/handlers/get_organization_boards.js +4 -0
- package/integration-data/trello/handlers/move_card_to_list.js +5 -0
- package/integration-data/trello/handlers/remove_member_from_card.js +9 -0
- package/integration-data/trello/handlers/search.js +5 -0
- package/integration-data/trello/handlers/update_card.js +19 -0
- package/integration-data/trello/handlers/update_list.js +11 -0
- package/integration-data/trello/manifest.json +231 -0
- package/integration-data/trello/schemas/add_checklist_to_card.json +10 -0
- package/integration-data/trello/schemas/add_member_to_card.json +10 -0
- package/integration-data/trello/schemas/archive_list.json +9 -0
- package/integration-data/trello/schemas/create_card.json +13 -0
- package/integration-data/trello/schemas/create_list.json +11 -0
- package/integration-data/trello/schemas/delete_card.json +9 -0
- package/integration-data/trello/schemas/display_trello_cards.json +45 -0
- package/integration-data/trello/schemas/empty.json +5 -0
- package/integration-data/trello/schemas/get_member.json +5 -0
- package/integration-data/trello/schemas/id_board.json +8 -0
- package/integration-data/trello/schemas/id_card.json +8 -0
- package/integration-data/trello/schemas/id_list.json +8 -0
- package/integration-data/trello/schemas/id_org.json +8 -0
- package/integration-data/trello/schemas/move_card_to_list.json +10 -0
- package/integration-data/trello/schemas/remove_member_from_card.json +10 -0
- package/integration-data/trello/schemas/search.json +8 -0
- package/integration-data/trello/schemas/update_card.json +16 -0
- package/integration-data/trello/schemas/update_list.json +12 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 19 November 2007
|
|
3
|
+
|
|
4
|
+
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
|
|
5
|
+
|
|
6
|
+
You may obtain a copy of the license at:
|
|
7
|
+
https://www.gnu.org/licenses/agpl-3.0.html
|
|
8
|
+
|
|
9
|
+
SPDX-License-Identifier: AGPL-3.0-only
|
|
10
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @commandable/mcp
|
|
2
|
+
|
|
3
|
+
Connect your everyday apps to any AI assistant that supports the Model Context Protocol (MCP). Commandable MCP is a single encrypted, self-hosted server and CLI that works with MCP clients like Claude Desktop and Cursor.
|
|
4
|
+
|
|
5
|
+
## Quick start
|
|
6
|
+
|
|
7
|
+
### 1) Run the setup wizard
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @commandable/mcp init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This walks you through selecting integrations and entering API credentials. Credentials are encrypted immediately and stored locally on your machine (not in your project).
|
|
14
|
+
|
|
15
|
+
### 2) Add the snippet to your MCP client
|
|
16
|
+
|
|
17
|
+
The wizard prints a JSON snippet to paste into your MCP client config.
|
|
18
|
+
|
|
19
|
+
For Claude Desktop, edit `~/Library/Application Support/Claude/claude_desktop_config.json` and add the `mcpServers.commandable` block.
|
|
20
|
+
|
|
21
|
+
### 3) Restart your MCP client
|
|
22
|
+
|
|
23
|
+
Restart Claude Desktop (or reload the Cursor window) so it picks up the new MCP server.
|
|
24
|
+
|
|
25
|
+
## CLI
|
|
26
|
+
|
|
27
|
+
- `npx @commandable/mcp init`: first-time setup
|
|
28
|
+
- `npx @commandable/mcp add`: add more integrations later
|
|
29
|
+
- `npx @commandable/mcp status`: show enabled integrations
|
|
30
|
+
|
|
31
|
+
## Repository
|
|
32
|
+
|
|
33
|
+
Source lives in the monorepo at `commandable-mcp/packages/server`.
|
|
34
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":""}
|
package/dist/cli/bin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type DbClient } from '../db/client.js';
|
|
2
|
+
import { SqlCredentialStore } from '../db/credentialStore.js';
|
|
3
|
+
export declare function getCommandableDir(): string;
|
|
4
|
+
export declare function getOrCreateEncryptionSecret(): string;
|
|
5
|
+
export declare function openLocalDb(): Promise<{
|
|
6
|
+
db: DbClient;
|
|
7
|
+
close: () => Promise<void>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function openLocalState(): Promise<{
|
|
10
|
+
db: DbClient;
|
|
11
|
+
credentialStore: SqlCredentialStore;
|
|
12
|
+
close: () => Promise<void>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function openCredentialStore(): Promise<{
|
|
15
|
+
store: SqlCredentialStore;
|
|
16
|
+
close: () => Promise<void>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function saveIntegrationCredentials(spaceId: string, credentialId: string, creds: Record<string, string>): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=credentialManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialManager.d.ts","sourceRoot":"","sources":["../../src/cli/credentialManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAS7D,wBAAgB,iBAAiB,IAAI,MAAM,CAS1C;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAkBpD;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAczF;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,eAAe,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAKjI;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAG9G;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAQpI"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
import { createDb } from '../db/client.js';
|
|
6
|
+
import { ensureSchema } from '../db/migrate.js';
|
|
7
|
+
import { SqlCredentialStore } from '../db/credentialStore.js';
|
|
8
|
+
function getDataDir() {
|
|
9
|
+
const base = process.env.COMMANDABLE_DATA_DIR;
|
|
10
|
+
if (base && base.trim().length)
|
|
11
|
+
return resolve(base);
|
|
12
|
+
return resolve(homedir(), '.commandable');
|
|
13
|
+
}
|
|
14
|
+
export function getCommandableDir() {
|
|
15
|
+
const dir = getDataDir();
|
|
16
|
+
if (!existsSync(dir)) {
|
|
17
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
try {
|
|
21
|
+
chmodSync(dir, 0o700);
|
|
22
|
+
}
|
|
23
|
+
catch { }
|
|
24
|
+
}
|
|
25
|
+
return dir;
|
|
26
|
+
}
|
|
27
|
+
export function getOrCreateEncryptionSecret() {
|
|
28
|
+
const envSecret = process.env.COMMANDABLE_ENCRYPTION_SECRET || process.env.COMMANDABLE_MCP_ENCRYPTION_SECRET;
|
|
29
|
+
if (envSecret && envSecret.trim().length)
|
|
30
|
+
return envSecret.trim();
|
|
31
|
+
const dir = getCommandableDir();
|
|
32
|
+
const keyPath = resolve(dir, 'encryption.key');
|
|
33
|
+
if (existsSync(keyPath)) {
|
|
34
|
+
const existing = readFileSync(keyPath, 'utf8').trim();
|
|
35
|
+
if (!existing)
|
|
36
|
+
throw new Error(`Encryption key file exists but is empty: ${keyPath}`);
|
|
37
|
+
return existing;
|
|
38
|
+
}
|
|
39
|
+
const secret = crypto.randomBytes(32).toString('hex');
|
|
40
|
+
writeFileSync(keyPath, `${secret}\n`, { mode: 0o600 });
|
|
41
|
+
try {
|
|
42
|
+
chmodSync(keyPath, 0o600);
|
|
43
|
+
}
|
|
44
|
+
catch { }
|
|
45
|
+
return secret;
|
|
46
|
+
}
|
|
47
|
+
export async function openLocalDb() {
|
|
48
|
+
const dir = getCommandableDir();
|
|
49
|
+
const sqlitePath = resolve(dir, 'credentials.sqlite');
|
|
50
|
+
const client = createDb({ sqlitePath });
|
|
51
|
+
await ensureSchema(client);
|
|
52
|
+
return {
|
|
53
|
+
db: client,
|
|
54
|
+
close: async () => {
|
|
55
|
+
if (client.dialect === 'sqlite')
|
|
56
|
+
client.close();
|
|
57
|
+
else
|
|
58
|
+
await client.close();
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export async function openLocalState() {
|
|
63
|
+
const { db, close } = await openLocalDb();
|
|
64
|
+
const secret = getOrCreateEncryptionSecret();
|
|
65
|
+
const credentialStore = new SqlCredentialStore(db, secret);
|
|
66
|
+
return { db, credentialStore, close };
|
|
67
|
+
}
|
|
68
|
+
export async function openCredentialStore() {
|
|
69
|
+
const { credentialStore, close } = await openLocalState();
|
|
70
|
+
return { store: credentialStore, close };
|
|
71
|
+
}
|
|
72
|
+
export async function saveIntegrationCredentials(spaceId, credentialId, creds) {
|
|
73
|
+
const { store, close } = await openCredentialStore();
|
|
74
|
+
try {
|
|
75
|
+
await store.saveCredentials(spaceId, credentialId, creds);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
await close();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=credentialManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialManager.js","sourceRoot":"","sources":["../../src/cli/credentialManager.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAiB,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,SAAS,UAAU;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA;IAC7C,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM;QAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,OAAO,OAAO,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAA;AAC3C,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,UAAU,EAAE,CAAA;IACxB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EA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
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAuDA,wBAAsB,IAAI,kBAkCzB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import picocolors from 'picocolors';
|
|
2
|
+
import { IntegrationProxy } from '../integrations/proxy.js';
|
|
3
|
+
import { buildMcpToolIndex } from '../mcp/toolAdapter.js';
|
|
4
|
+
import { runStdioMcpServer } from '../mcp/server.js';
|
|
5
|
+
import { runAddInteractive, runInitInteractive } from './setup.js';
|
|
6
|
+
import { openLocalState } from './credentialManager.js';
|
|
7
|
+
import { listIntegrations } from '../db/integrationStore.js';
|
|
8
|
+
function hasFlag(...flags) {
|
|
9
|
+
return flags.some(f => process.argv.includes(f));
|
|
10
|
+
}
|
|
11
|
+
function help(exitCode = 0) {
|
|
12
|
+
const lines = [
|
|
13
|
+
'',
|
|
14
|
+
`${picocolors.bold('Commandable MCP')} — connect your apps to MCP clients`,
|
|
15
|
+
'',
|
|
16
|
+
picocolors.bold('Usage'),
|
|
17
|
+
` ${picocolors.cyan('commandable-mcp init')}`,
|
|
18
|
+
` ${picocolors.cyan('commandable-mcp add')}`,
|
|
19
|
+
` ${picocolors.cyan('commandable-mcp status')}`,
|
|
20
|
+
` ${picocolors.cyan('commandable-mcp')} ${picocolors.dim('(start MCP server)')}`,
|
|
21
|
+
'',
|
|
22
|
+
picocolors.bold('Notes'),
|
|
23
|
+
`- Credentials entered via the CLI are stored encrypted at ${picocolors.dim('~/.commandable/')} (override with ${picocolors.cyan('COMMANDABLE_DATA_DIR')}).`,
|
|
24
|
+
`- MCP clients (Claude Desktop, Cursor) spawn this server process automatically via: ${picocolors.cyan('npx @commandable/mcp')}`,
|
|
25
|
+
'',
|
|
26
|
+
];
|
|
27
|
+
console.error(lines.join('\n'));
|
|
28
|
+
process.exit(exitCode);
|
|
29
|
+
}
|
|
30
|
+
async function runStdioFromDb() {
|
|
31
|
+
const spaceId = 'local';
|
|
32
|
+
const { db, credentialStore } = await openLocalState();
|
|
33
|
+
const integrations = await listIntegrations(db, spaceId);
|
|
34
|
+
if (!integrations.length) {
|
|
35
|
+
console.error(`No integrations configured yet. Run ${picocolors.cyan('commandable-mcp init')}.`);
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
const proxy = new IntegrationProxy({
|
|
39
|
+
credentialStore,
|
|
40
|
+
trelloApiKey: process.env.TRELLO_API_KEY,
|
|
41
|
+
});
|
|
42
|
+
const index = buildMcpToolIndex({ spaceId, integrations, proxy });
|
|
43
|
+
await runStdioMcpServer({
|
|
44
|
+
serverInfo: { name: 'commandable', version: '0.0.1' },
|
|
45
|
+
tools: { list: index.tools, byName: index.byName },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export async function main() {
|
|
49
|
+
const cmd = process.argv[2];
|
|
50
|
+
if (hasFlag('--help', '-h'))
|
|
51
|
+
help(0);
|
|
52
|
+
if (cmd === 'init')
|
|
53
|
+
return await runInitInteractive();
|
|
54
|
+
if (cmd === 'add')
|
|
55
|
+
return await runAddInteractive();
|
|
56
|
+
if (cmd === 'status') {
|
|
57
|
+
const { db, close } = await openLocalState();
|
|
58
|
+
try {
|
|
59
|
+
const items = await listIntegrations(db, 'local');
|
|
60
|
+
if (!items.length) {
|
|
61
|
+
console.error('No integrations configured.');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
console.error('Enabled integrations:');
|
|
65
|
+
for (const it of items)
|
|
66
|
+
console.error(`- ${it.type}`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
await close();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (cmd && !cmd.startsWith('-'))
|
|
74
|
+
help(1);
|
|
75
|
+
return await runStdioFromDb();
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/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B,OAAO,MAAM,kBAAkB,EAAE,CAAA;IAEnC,IAAI,GAAG,KAAK,KAAK;QACf,OAAO,MAAM,iBAAiB,EAAE,CAAA;IAElC,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,MAAM,cAAc,EAAE,CAAA;QAC5C,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;gBAC5C,OAAM;YACR,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;YACtC,KAAK,MAAM,EAAE,IAAI,KAAK;gBACpB,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;YAC/B,OAAM;QACR,CAAC;gBACO,CAAC;YACP,MAAM,KAAK,EAAE,CAAA;QACf,CAAC;IACH,CAAC;IAED,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAC7B,IAAI,CAAC,CAAC,CAAC,CAAA;IAET,OAAO,MAAM,cAAc,EAAE,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"AA4JA,wBAAsB,kBAAkB,kBAmCvC;AAED,wBAAsB,iBAAiB,kBA0CtC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import picocolors from 'picocolors';
|
|
5
|
+
import { intro, isCancel, log, multiselect, note, outro, password, text, } from '@clack/prompts';
|
|
6
|
+
import { listIntegrationCatalog } from '../integrations/catalog.js';
|
|
7
|
+
import { loadIntegrationCredentialConfig } from '../integrations/dataLoader.js';
|
|
8
|
+
import { getCommandableDir, openLocalState } from './credentialManager.js';
|
|
9
|
+
import { listIntegrations, upsertIntegration } from '../db/integrationStore.js';
|
|
10
|
+
function isTruthyString(v) {
|
|
11
|
+
return typeof v === 'string' && v.trim().length > 0;
|
|
12
|
+
}
|
|
13
|
+
function isProbablySecretKeyName(key) {
|
|
14
|
+
const k = key.toLowerCase();
|
|
15
|
+
return k.includes('token') || k.includes('secret') || k.includes('password') || k.endsWith('key') || k.includes('apikey');
|
|
16
|
+
}
|
|
17
|
+
function formatIntegrationOption(type, name) {
|
|
18
|
+
if (!name || name === type)
|
|
19
|
+
return type;
|
|
20
|
+
return `${type} ${picocolors.dim(`(${name})`)}`;
|
|
21
|
+
}
|
|
22
|
+
function getIntegrationHintMarkdown(type) {
|
|
23
|
+
const root = process.env.COMMANDABLE_INTEGRATION_DATA_DIR
|
|
24
|
+
? resolve(process.env.COMMANDABLE_INTEGRATION_DATA_DIR)
|
|
25
|
+
: resolve(fileURLToPath(new URL('../../integration-data/', import.meta.url)));
|
|
26
|
+
const hintPath = resolve(root, type, 'credentials_hint.md');
|
|
27
|
+
if (!existsSync(hintPath))
|
|
28
|
+
return null;
|
|
29
|
+
try {
|
|
30
|
+
const hint = readFileSync(hintPath, 'utf8').trim();
|
|
31
|
+
return hint.length ? hint : null;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function selectIntegrations(args) {
|
|
38
|
+
const catalog = listIntegrationCatalog();
|
|
39
|
+
const options = catalog
|
|
40
|
+
.filter(it => !args.excludeTypes?.has(it.type))
|
|
41
|
+
.filter(it => !!loadIntegrationCredentialConfig(it.type))
|
|
42
|
+
.map(it => ({ value: it.type, label: formatIntegrationOption(it.type, it.name) }))
|
|
43
|
+
.sort((a, b) => a.value.localeCompare(b.value));
|
|
44
|
+
if (!options.length) {
|
|
45
|
+
log.info('No locally-configurable integrations available yet.');
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const selected = await multiselect({
|
|
49
|
+
message: args.title,
|
|
50
|
+
options,
|
|
51
|
+
required: true,
|
|
52
|
+
});
|
|
53
|
+
if (isCancel(selected))
|
|
54
|
+
return null;
|
|
55
|
+
const types = selected.map(s => String(s)).filter(Boolean);
|
|
56
|
+
return types;
|
|
57
|
+
}
|
|
58
|
+
async function promptCredentialsForIntegration(type) {
|
|
59
|
+
const credCfg = loadIntegrationCredentialConfig(type);
|
|
60
|
+
const schema = credCfg?.schema;
|
|
61
|
+
if (!schema || typeof schema !== 'object')
|
|
62
|
+
return {};
|
|
63
|
+
const props = schema.properties || {};
|
|
64
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
65
|
+
const keys = Object.keys(props);
|
|
66
|
+
if (!keys.length)
|
|
67
|
+
return {};
|
|
68
|
+
const hint = getIntegrationHintMarkdown(type);
|
|
69
|
+
if (hint) {
|
|
70
|
+
note(hint, `${type}: setup hint`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
log.info(picocolors.dim(`No setup hint found for ${type}.`));
|
|
74
|
+
}
|
|
75
|
+
const creds = {};
|
|
76
|
+
for (const key of keys) {
|
|
77
|
+
const isReq = required.includes(key);
|
|
78
|
+
const def = props[key] || {};
|
|
79
|
+
const title = isTruthyString(def?.title) ? def.title : key;
|
|
80
|
+
const description = (hint == null && isTruthyString(def?.description)) ? def.description : null;
|
|
81
|
+
const label = `${title}${isReq ? ' (required)' : ' (optional)'}`;
|
|
82
|
+
const message = description
|
|
83
|
+
? `${label} ${picocolors.dim(`— ${description}`)}`
|
|
84
|
+
: label;
|
|
85
|
+
while (true) {
|
|
86
|
+
const result = isProbablySecretKeyName(key)
|
|
87
|
+
? await password({ message })
|
|
88
|
+
: await text({ message });
|
|
89
|
+
if (isCancel(result))
|
|
90
|
+
return null;
|
|
91
|
+
const value = String(result ?? '').trim();
|
|
92
|
+
if (!value) {
|
|
93
|
+
if (isReq) {
|
|
94
|
+
log.error(`${picocolors.cyan(title)} is required.`);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
creds[key] = value;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return creds;
|
|
104
|
+
}
|
|
105
|
+
function makeClaudeDesktopSnippet() {
|
|
106
|
+
return {
|
|
107
|
+
mcpServers: {
|
|
108
|
+
commandable: {
|
|
109
|
+
command: 'npx',
|
|
110
|
+
args: ['@commandable/mcp'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function makeIntegrationRecord(type) {
|
|
116
|
+
return {
|
|
117
|
+
spaceId: 'local',
|
|
118
|
+
id: type,
|
|
119
|
+
type,
|
|
120
|
+
referenceId: type,
|
|
121
|
+
label: type,
|
|
122
|
+
connectionMethod: 'credentials',
|
|
123
|
+
credentialId: `${type}-creds`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export async function runInitInteractive() {
|
|
127
|
+
intro('Commandable MCP');
|
|
128
|
+
const types = await selectIntegrations({
|
|
129
|
+
title: 'Which integrations do you want to connect?',
|
|
130
|
+
});
|
|
131
|
+
if (types === null) {
|
|
132
|
+
outro('Cancelled.');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const { db, credentialStore, close } = await openLocalState();
|
|
136
|
+
try {
|
|
137
|
+
for (const type of types) {
|
|
138
|
+
log.info(`Configuring ${picocolors.cyan(type)}`);
|
|
139
|
+
const credentials = await promptCredentialsForIntegration(type);
|
|
140
|
+
if (credentials === null) {
|
|
141
|
+
outro('Cancelled.');
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const integration = makeIntegrationRecord(type);
|
|
145
|
+
await credentialStore.saveCredentials('local', integration.credentialId, credentials);
|
|
146
|
+
await upsertIntegration(db, integration);
|
|
147
|
+
}
|
|
148
|
+
log.success(`Credentials saved (encrypted) to ${picocolors.dim(getCommandableDir())}`);
|
|
149
|
+
log.info('Claude Desktop config snippet (plain JSON):');
|
|
150
|
+
process.stdout.write(`${JSON.stringify(makeClaudeDesktopSnippet(), null, 2)}\n`);
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
await close();
|
|
154
|
+
}
|
|
155
|
+
outro('You’re all set. Restart your MCP client and try a tool call.');
|
|
156
|
+
}
|
|
157
|
+
export async function runAddInteractive() {
|
|
158
|
+
intro('Commandable MCP');
|
|
159
|
+
const { db, credentialStore, close } = await openLocalState();
|
|
160
|
+
try {
|
|
161
|
+
const existing = await listIntegrations(db, 'local');
|
|
162
|
+
const existingTypes = new Set(existing.map(i => i.type).filter(Boolean));
|
|
163
|
+
const types = await selectIntegrations({
|
|
164
|
+
title: 'Which integrations do you want to add?',
|
|
165
|
+
excludeTypes: existingTypes,
|
|
166
|
+
});
|
|
167
|
+
if (types === null) {
|
|
168
|
+
outro('Cancelled.');
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const added = [];
|
|
172
|
+
for (const type of types) {
|
|
173
|
+
log.info(`Configuring ${picocolors.cyan(type)}`);
|
|
174
|
+
const credentials = await promptCredentialsForIntegration(type);
|
|
175
|
+
if (credentials === null) {
|
|
176
|
+
outro('Cancelled.');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const integration = makeIntegrationRecord(type);
|
|
180
|
+
await credentialStore.saveCredentials('local', integration.credentialId, credentials);
|
|
181
|
+
await upsertIntegration(db, integration);
|
|
182
|
+
added.push(type);
|
|
183
|
+
}
|
|
184
|
+
if (added.length)
|
|
185
|
+
log.success(`Added: ${added.map(t => picocolors.cyan(t)).join(', ')}`);
|
|
186
|
+
else
|
|
187
|
+
log.info('Nothing to add.');
|
|
188
|
+
}
|
|
189
|
+
finally {
|
|
190
|
+
await close();
|
|
191
|
+
}
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AAC,IAAI,CAAC,EAAE,CAAC,CAAA;;YAEtE,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC/B,CAAC;YACO,CAAC;QACP,MAAM,KAAK,EAAE,CAAA;IACf,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/crypto/encryption.ts"],"names":[],"mappings":"AAQA,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED,wBAAgB,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAcrE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
const algorithm = 'aes-256-cbc';
|
|
3
|
+
function getKey(secret) {
|
|
4
|
+
return crypto.createHash('sha256').update(secret).digest();
|
|
5
|
+
}
|
|
6
|
+
export function encrypt(text, secret) {
|
|
7
|
+
const key = getKey(secret);
|
|
8
|
+
const iv = crypto.randomBytes(16);
|
|
9
|
+
const cipher = crypto.createCipheriv(algorithm, key, iv);
|
|
10
|
+
let encrypted = cipher.update(text, 'utf8', 'hex');
|
|
11
|
+
encrypted += cipher.final('hex');
|
|
12
|
+
return `${iv.toString('hex')}:${encrypted}`;
|
|
13
|
+
}
|
|
14
|
+
export function decrypt(encryptedText, secret) {
|
|
15
|
+
const key = getKey(secret);
|
|
16
|
+
const parts = encryptedText.split(':');
|
|
17
|
+
if (parts.length !== 2)
|
|
18
|
+
throw new Error('Invalid encrypted text format');
|
|
19
|
+
const ivHex = parts[0];
|
|
20
|
+
const encrypted = parts[1];
|
|
21
|
+
if (!ivHex || !encrypted)
|
|
22
|
+
throw new Error('Invalid encrypted text format');
|
|
23
|
+
const iv = Buffer.from(ivHex, 'hex');
|
|
24
|
+
const decipher = crypto.createDecipheriv(algorithm, key, iv);
|
|
25
|
+
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
|
|
26
|
+
decrypted += decipher.final('utf8');
|
|
27
|
+
return decrypted;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=encryption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encryption.js","sourceRoot":"","sources":["../../src/crypto/encryption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,MAAM,SAAS,GAAG,aAAa,CAAA;AAE/B,SAAS,MAAM,CAAC,MAAc;IAC5B,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,MAAc;IAClD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACjC,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IAExD,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAClD,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAChC,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,EAAE,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,aAAqB,EAAE,MAAc;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAClD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS;QACtB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAClD,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IAC5D,IAAI,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACzD,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACnC,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { drizzle as drizzleSqlite } from 'drizzle-orm/better-sqlite3';
|
|
2
|
+
import { drizzle as drizzlePg } from 'drizzle-orm/node-postgres';
|
|
3
|
+
import { Pool } from 'pg';
|
|
4
|
+
export type DbDialect = 'sqlite' | 'postgres';
|
|
5
|
+
export type DbClient = {
|
|
6
|
+
dialect: 'sqlite';
|
|
7
|
+
db: ReturnType<typeof drizzleSqlite>;
|
|
8
|
+
raw: any;
|
|
9
|
+
close: () => void;
|
|
10
|
+
} | {
|
|
11
|
+
dialect: 'postgres';
|
|
12
|
+
db: ReturnType<typeof drizzlePg>;
|
|
13
|
+
raw: Pool;
|
|
14
|
+
close: () => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
export interface CreateDbOptions {
|
|
17
|
+
sqlitePath?: string;
|
|
18
|
+
databaseUrl?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function createDbFromEnv(): DbClient;
|
|
21
|
+
export declare function createDb(opts?: CreateDbOptions): DbClient;
|
|
22
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/db/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAA;AAEzB,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE7C,MAAM,MAAM,QAAQ,GAChB;IAAE,OAAO,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,GACxF;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;IAAC,GAAG,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAA;AAEpG,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,eAAe,IAAI,QAAQ,CAS1C;AAED,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,QAAQ,CA2B7D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import Database from 'better-sqlite3';
|
|
4
|
+
import { drizzle as drizzleSqlite } from 'drizzle-orm/better-sqlite3';
|
|
5
|
+
import { drizzle as drizzlePg } from 'drizzle-orm/node-postgres';
|
|
6
|
+
import { Pool } from 'pg';
|
|
7
|
+
export function createDbFromEnv() {
|
|
8
|
+
const dataDir = process.env.COMMANDABLE_DATA_DIR;
|
|
9
|
+
const sqliteFromDataDir = dataDir && dataDir.trim().length
|
|
10
|
+
? resolve(dataDir, 'credentials.sqlite')
|
|
11
|
+
: undefined;
|
|
12
|
+
return createDb({
|
|
13
|
+
databaseUrl: process.env.DATABASE_URL,
|
|
14
|
+
sqlitePath: process.env.COMMANDABLE_MCP_SQLITE_PATH || sqliteFromDataDir,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function createDb(opts = {}) {
|
|
18
|
+
const databaseUrl = opts.databaseUrl || process.env.DATABASE_URL;
|
|
19
|
+
if (databaseUrl) {
|
|
20
|
+
const pool = new Pool({ connectionString: databaseUrl });
|
|
21
|
+
const db = drizzlePg(pool);
|
|
22
|
+
return {
|
|
23
|
+
dialect: 'postgres',
|
|
24
|
+
db,
|
|
25
|
+
raw: pool,
|
|
26
|
+
close: async () => {
|
|
27
|
+
await pool.end();
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const sqlitePath = opts.sqlitePath
|
|
32
|
+
? resolve(opts.sqlitePath)
|
|
33
|
+
: resolve(homedir(), '.commandable', 'credentials.sqlite');
|
|
34
|
+
const sqlite = new Database(sqlitePath);
|
|
35
|
+
const db = drizzleSqlite(sqlite);
|
|
36
|
+
return {
|
|
37
|
+
dialect: 'sqlite',
|
|
38
|
+
db,
|
|
39
|
+
raw: sqlite,
|
|
40
|
+
close: () => sqlite.close(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/db/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC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AC,CAAA;IAE5D,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAA;IACvC,MAAM,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IAChC,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,EAAE;QACF,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;KAC5B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CredentialStore } from '../integrations/proxy.js';
|
|
2
|
+
import type { DbClient } from './client.js';
|
|
3
|
+
export declare class SqlCredentialStore implements CredentialStore {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private readonly encryptionSecret;
|
|
6
|
+
constructor(client: DbClient, encryptionSecret: string);
|
|
7
|
+
hasCredentials(spaceId: string, credentialId: string): Promise<boolean>;
|
|
8
|
+
saveCredentials(spaceId: string, credentialId: string, credentials: Record<string, string>): Promise<void>;
|
|
9
|
+
getCredentials(spaceId: string, credentialId: string): Promise<Record<string, string> | null>;
|
|
10
|
+
deleteCredentials(spaceId: string, credentialId: string): Promise<void>;
|
|
11
|
+
private _getRow;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=credentialStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialStore.d.ts","sourceRoot":"","sources":["../../src/db/credentialStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,qBAAa,kBAAmB,YAAW,eAAe;IAEtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,MAAM;IAGrC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB1G,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAS7F,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAO/D,OAAO;CAStB"}
|