@cmd233/mcp-database-server 1.1.4 → 1.1.6

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.
@@ -271,7 +271,12 @@ export class SqlServerAdapter {
271
271
  INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk ON kcu.CONSTRAINT_NAME = pk.CONSTRAINT_NAME AND pk.CONSTRAINT_TYPE = 'PRIMARY KEY'
272
272
  LEFT JOIN
273
273
  sys.extended_properties ep
274
- ON ep.major_id = OBJECT_ID(SCHEMA_NAME(c.TABLE_SCHEMA) + '.' + c.TABLE_NAME)
274
+ ON ep.major_id = (
275
+ SELECT t.object_id
276
+ FROM sys.tables t
277
+ INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
278
+ WHERE t.name = '${tableName}' AND s.name = c.TABLE_SCHEMA
279
+ )
275
280
  AND ep.minor_id = c.ORDINAL_POSITION
276
281
  AND ep.name = 'MS_Description'
277
282
  WHERE
@@ -59,7 +59,8 @@ export async function handleReadResource(uri) {
59
59
  mimeType: "application/json",
60
60
  text: JSON.stringify(result.map((column) => ({
61
61
  column_name: column.name,
62
- data_type: column.type
62
+ data_type: column.type,
63
+ comment: column.comment || null
63
64
  })), null, 2),
64
65
  },
65
66
  ],
@@ -109,7 +109,8 @@ export async function describeTable(tableName) {
109
109
  type: col.type,
110
110
  notnull: !!col.notnull,
111
111
  default_value: col.dflt_value,
112
- primary_key: !!col.pk
112
+ primary_key: !!col.pk,
113
+ comment: col.comment || null
113
114
  })));
114
115
  }
115
116
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmd233/mcp-database-server",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "MCP server for interacting with SQLite, SQL Server, PostgreSQL and MySQL databases (Fixed nullable field detection)",
5
5
  "license": "MIT",
6
6
  "author": "cmd233",