Skip to content

Commit 07073d3

Browse files
atlineJoshMock
andauthored
Fix default user value (#106)
If there is no apikey specified, the mcp server will simply skip the username/password, which make MCP server can't connect to elasticsearch. This is a regresstion by 35cc88e Signed-off-by: Larry Shen <[email protected]> Co-authored-by: Josh Mock <[email protected]>
1 parent 94b5602 commit 07073d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,13 @@ export async function createElasticsearchMcpServer (config: ElasticsearchConfig)
490490

491491
const config: ElasticsearchConfig = {
492492
url: process.env.ES_URL ?? '',
493-
apiKey: process.env.ES_API_KEY ?? '',
494-
username: process.env.ES_USERNAME ?? '',
495-
password: process.env.ES_PASSWORD ?? '',
496-
caCert: process.env.ES_CA_CERT ?? '',
497-
version: process.env.ES_VERSION ?? '',
493+
apiKey: process.env.ES_API_KEY,
494+
username: process.env.ES_USERNAME,
495+
password: process.env.ES_PASSWORD,
496+
caCert: process.env.ES_CA_CERT,
497+
version: process.env.ES_VERSION,
498498
sslSkipVerify: process.env.ES_SSL_SKIP_VERIFY === '1' || process.env.ES_SSL_SKIP_VERIFY === 'true',
499-
pathPrefix: process.env.ES_PATH_PREFIX ?? ''
499+
pathPrefix: process.env.ES_PATH_PREFIX
500500
}
501501

502502
async function main (): Promise<void> {

0 commit comments

Comments
 (0)