Expose webshare_search, webshare_get_link, and webshare_login_check over stdio via the Model Context Protocol SDK. Document client configuration.
20 lines
641 B
JavaScript
20 lines
641 B
JavaScript
const { formatSize, createWebshareMcpServer } = require('../src/mcp-server');
|
|
|
|
describe('formatSize', () => {
|
|
it('formats bytes', () => {
|
|
expect(formatSize(0)).toBe('0 B');
|
|
expect(formatSize(512)).toBe('512 B');
|
|
expect(formatSize(1024)).toBe('1.0 KB');
|
|
expect(formatSize(1536)).toBe('1.5 KB');
|
|
expect(formatSize(1024 * 1024)).toBe('1.0 MB');
|
|
});
|
|
});
|
|
|
|
describe('createWebshareMcpServer', () => {
|
|
it('creates a server instance with credentials', () => {
|
|
const server = createWebshareMcpServer({ username: 'u', password: 'p' });
|
|
expect(server).toBeDefined();
|
|
expect(server.server).toBeDefined();
|
|
});
|
|
});
|