Skip to content

Commit 561fefe

Browse files
update readme
1 parent 603e426 commit 561fefe

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

smithery.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ startCommand:
33
type: stdio
44
configSchema:
55
# JSON Schema defining the configuration options for the MCP.
6-
{}
6+
{
7+
"YML":"src/xiyan_mcp_server/config_demo.yml"
8+
}
79
commandFunction:
810
# A function that produces the CLI command to start the MCP on stdio.
911
|-
@@ -12,7 +14,5 @@ startCommand:
1214
"args": [
1315
"-m",
1416
"xiyan-mcp-server"
15-
],
16-
"env": {
17-
}
17+
]
1818
})

src/xiyan_mcp_server/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ def get_xiyan_config(db_config):
4646
global_config = get_yml_config()
4747
#print(global_config)
4848
model_config = global_config['model']
49-
global_db_config = global_config['database']
49+
global_db_config = global_config.get('database')
50+
database_name = global_db_config.get('database','')
5051
global_xiyan_db_config = get_xiyan_config(global_db_config)
5152
dialect = global_db_config.get('dialect','mysql')
5253
#print("dialect is !!!!"+dialect)
5354

54-
@mcp.resource(dialect+'://'+global_db_config['database'])
55+
@mcp.resource(dialect+'://'+global_xiyan_db_config)
5556
async def read_resource() -> str:
5657

5758
db_engine = init_db_conn(global_xiyan_db_config)

0 commit comments

Comments
 (0)