Skip to content

Commit 4fb1994

Browse files
fix: use /api/v1/ prefix for all API endpoints
The Vercel deployment routes through /api/ — requests to /v1/verify returned 404. Changed all paths to /api/v1/verify, /api/v1/verify/bulk, and /api/v1/stats. Bump version to 1.1.2.
1 parent 95c803a commit 4fb1994

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@validkit/mcp-server",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Model Context Protocol (MCP) server for ValidKit email validation - works with Claude Code, Cursor, Windsurf, and any MCP-compatible AI assistant",
55
"main": "dist/index.js",
66
"type": "module",

src/index.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('ValidKit MCP Server', () => {
131131
expect(parsed.valid).toBe(true);
132132

133133
expect(mockFetch).toHaveBeenCalledWith(
134-
'https://api.validkit.com/v1/verify',
134+
'https://api.validkit.com/api/v1/verify',
135135
expect.objectContaining({
136136
method: 'POST',
137137
body: JSON.stringify({ email: 'test@gmail.com' }),
@@ -278,7 +278,7 @@ describe('ValidKit MCP Server', () => {
278278

279279
// Verify correct endpoint and body
280280
expect(mockFetch).toHaveBeenCalledWith(
281-
'https://api.validkit.com/v1/verify/bulk',
281+
'https://api.validkit.com/api/v1/verify/bulk',
282282
expect.objectContaining({
283283
body: JSON.stringify({ emails: ['a@gmail.com', 'b@fake.xyz'] }),
284284
})
@@ -370,7 +370,7 @@ describe('ValidKit MCP Server', () => {
370370
expect(parsed.remaining).toBe(958);
371371

372372
expect(mockFetch).toHaveBeenCalledWith(
373-
'https://api.validkit.com/v1/stats',
373+
'https://api.validkit.com/api/v1/stats',
374374
expect.objectContaining({ method: 'GET' })
375375
);
376376
});
@@ -465,7 +465,7 @@ describe('ValidKit MCP Server', () => {
465465
});
466466

467467
expect(mockFetch).toHaveBeenCalledWith(
468-
'https://custom.api.com/v1/verify',
468+
'https://custom.api.com/api/v1/verify',
469469
expect.anything()
470470
);
471471
});
@@ -485,7 +485,7 @@ describe('ValidKit MCP Server', () => {
485485
expect.objectContaining({
486486
headers: expect.objectContaining({
487487
'X-API-Key': 'vk_test_mykey',
488-
'User-Agent': 'validkit-mcp/1.1.1',
488+
'User-Agent': 'validkit-mcp/1.1.2',
489489
'Content-Type': 'application/json',
490490
}),
491491
})
@@ -595,7 +595,7 @@ describe('ValidKit MCP Server', () => {
595595
});
596596

597597
expect(mockFetch).toHaveBeenCalledWith(
598-
'https://api.validkit.com/v1/verify',
598+
'https://api.validkit.com/api/v1/verify',
599599
expect.anything()
600600
);
601601
});
@@ -722,7 +722,7 @@ describe('ValidKit MCP Server', () => {
722722
const circular: Record<string, unknown> = {};
723723
circular.self = circular;
724724

725-
await expect(callApi('/v1/verify', 'POST', circular)).rejects.toThrow(
725+
await expect(callApi('/api/v1/verify', 'POST', circular)).rejects.toThrow(
726726
'Failed to serialize request body'
727727
);
728728
});
@@ -776,7 +776,7 @@ describe('ValidKit MCP Server', () => {
776776
const output = await spawnAndSend(distIndex);
777777
const response = JSON.parse(output.trim());
778778
expect(response.result.serverInfo.name).toBe('validkit');
779-
expect(response.result.serverInfo.version).toBe('1.1.1');
779+
expect(response.result.serverInfo.version).toBe('1.1.2');
780780
});
781781

782782
it('starts and responds when invoked via symlink (npx simulation)', async () => {
@@ -792,7 +792,7 @@ describe('ValidKit MCP Server', () => {
792792
const output = await spawnAndSend(symlink);
793793
const response = JSON.parse(output.trim());
794794
expect(response.result.serverInfo.name).toBe('validkit');
795-
expect(response.result.serverInfo.version).toBe('1.1.1');
795+
expect(response.result.serverInfo.version).toBe('1.1.2');
796796
} finally {
797797
unlinkSync(symlink);
798798
}

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
55
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
66
import { z } from 'zod';
77

8-
export const VERSION = '1.1.1';
8+
export const VERSION = '1.1.2';
99
const REQUEST_TIMEOUT_MS = 30_000;
1010

1111
export function formatCatchError(error: unknown, prefix: string): string {
@@ -151,7 +151,7 @@ export function createServer(): McpServer {
151151
},
152152
async ({ email }) => {
153153
try {
154-
const { ok, status, data } = await callApi('/v1/verify', 'POST', {
154+
const { ok, status, data } = await callApi('/api/v1/verify', 'POST', {
155155
email,
156156
});
157157

@@ -199,7 +199,7 @@ export function createServer(): McpServer {
199199
async ({ emails }) => {
200200
try {
201201
const { ok, status, data } = await callApi(
202-
'/v1/verify/bulk',
202+
'/api/v1/verify/bulk',
203203
'POST',
204204
{ emails }
205205
);
@@ -240,7 +240,7 @@ export function createServer(): McpServer {
240240
},
241241
async () => {
242242
try {
243-
const { ok, status, data } = await callApi('/v1/stats', 'GET');
243+
const { ok, status, data } = await callApi('/api/v1/stats', 'GET');
244244

245245
if (!ok) {
246246
const error = formatApiError(status, data);

0 commit comments

Comments
 (0)