mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-14 09:46:03 +00:00
feat(mcp): persist and display marketplace README
Capture the README markdown from LangBot Space when installing an MCP server and store it on the mcp_servers record (new readme column + alembic migration 0004). The detail page can then render docs offline, independent of the server's runtime/connection state.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""add readme column to mcp_servers
|
||||
|
||||
Revision ID: 0004_add_mcp_readme
|
||||
Revises: 0003_add_rerank_models
|
||||
Create Date: 2026-06-06
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision = '0004_add_mcp_readme'
|
||||
down_revision = '0003_add_rerank_models'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Add ``readme`` to mcp_servers if the table exists and the column is missing
|
||||
# (the table may have been created by create_all() with the column already
|
||||
# present on fresh installs, so guard against duplicate-add).
|
||||
conn = op.get_bind()
|
||||
inspector = sa.inspect(conn)
|
||||
if 'mcp_servers' not in inspector.get_table_names():
|
||||
return
|
||||
columns = {col['name'] for col in inspector.get_columns('mcp_servers')}
|
||||
if 'readme' not in columns:
|
||||
op.add_column(
|
||||
'mcp_servers',
|
||||
sa.Column('readme', sa.Text(), nullable=False, server_default=''),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column('mcp_servers', 'readme')
|
||||
Reference in New Issue
Block a user