eassist-mcp 1.0.0 → 1.0.2

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.
package/build/auth.js CHANGED
@@ -28,10 +28,7 @@ class AuthManager {
28
28
  return new Date(expiresAt).getTime() - 60_000 < Date.now();
29
29
  }
30
30
  getApiUrl() {
31
- const url = process.env.EASSIST_API_URL ?? this.data?.apiUrl;
32
- if (!url)
33
- throw new Error('EASSIST_API_URL environment variable is required');
34
- return url.replace(/\/$/, '');
31
+ return (process.env.EASSIST_API_URL ?? this.data?.apiUrl ?? 'https://eassist.forsysinc.com').replace(/\/$/, '');
35
32
  }
36
33
  async getValidToken() {
37
34
  if (!this.data)
@@ -44,7 +41,7 @@ class AuthManager {
44
41
  if (this.data?.refreshToken) {
45
42
  try {
46
43
  const apiUrl = this.getApiUrl();
47
- const res = await axios.post(`${apiUrl}/auth/refresh`, { refreshToken: this.data.refreshToken });
44
+ const res = await axios.post(`${apiUrl}/api/auth/refresh`, { refreshToken: this.data.refreshToken });
48
45
  const { token, refreshToken, expiresAt } = res.data;
49
46
  this.store({ ...this.data, accessToken: token, refreshToken, expiresAt });
50
47
  return token;
@@ -91,7 +88,7 @@ class AuthManager {
91
88
  }
92
89
  });
93
90
  server.listen(port, '127.0.0.1', async () => {
94
- const authUrl = `${apiUrl}/auth/mcp?port=${port}`;
91
+ const authUrl = `${apiUrl}/api/auth/mcp?port=${port}`;
95
92
  console.error(`\n[eassist-mcp] Opening browser for authentication...\n${authUrl}\n`);
96
93
  try {
97
94
  const { default: open } = await import('open');
package/build/client.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import axios from 'axios';
2
2
  import { auth } from './auth.js';
3
+ const DEFAULT_API_URL = 'https://eassist.forsysinc.com';
3
4
  function getApiUrl() {
4
- const url = process.env.EASSIST_API_URL;
5
- if (!url)
6
- throw new Error('EASSIST_API_URL environment variable is required');
7
- return url.replace(/\/$/, '');
5
+ return (process.env.EASSIST_API_URL ?? DEFAULT_API_URL).replace(/\/$/, '');
8
6
  }
9
7
  async function headers() {
10
8
  const token = await auth.getValidToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eassist-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for EAssist — query and manage actions & initiatives via Claude",
5
5
  "type": "module",
6
6
  "bin": {